mqtt

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MIT Imports: 11 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 AgentConfig

type AgentConfig interface {
	GetConfig(string, interface{}) error
}

type MQTTClient

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

func NewMQTTClient

func NewMQTTClient(cfg AgentConfig) (*MQTTClient, error)

func (*MQTTClient) Publish

func (c *MQTTClient) Publish(msgs ...*MQTTMsg) error

func (*MQTTClient) Subscribe

func (c *MQTTClient) Subscribe(subs ...*MQTTSubscription) error

type MQTTMsg

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

type MQTTSubscription

type MQTTSubscription 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