mqtt

package
v2.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DiscoveryPrefix = "homeassistant"
	DefaultServer   = "localhost:1883"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewMQTTClient

func NewMQTTClient() (*Client, error)

func (*Client) Publish

func (c *Client) Publish(msgs ...*Msg) error

func (*Client) Subscribe

func (c *Client) Subscribe(subs ...*Subscription) error

type Msg

type Msg struct {
	Topic    string
	Message  json.RawMessage
	QOS      byte
	Retained bool
}

type Subscription

type Subscription struct {
	Callback func(MQTT.Client, MQTT.Message)
	Topic    string
	QOS      byte
	Retained bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL