mosquitto

package
v0.0.0-...-e670723 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

func New

func New(config *MqttConfig) (*Connection, error)

func (*Connection) InsertDiscoveryRecord

func (conn *Connection) InsertDiscoveryRecord(discovery string, state string, fields []ports.DiscoveryField) error

MQTT Discovery: https://www.home-assistant.io/integrations/mqtt/#mqtt-discovery

func (*Connection) InsertRecord

func (conn *Connection) InsertRecord(m map[string]interface{}) error

func (*Connection) Subscribe

func (conn *Connection) Subscribe(topic string, callback mqtt.MessageHandler)

type MqttConfig

type MqttConfig struct {
	Url       string  `yaml:"url"`
	User      string  `yaml:"user"`
	Password  string  `yaml:"password"`
	Discovery *string `yaml:"ha_discovery_prefix,omitempty"`
	Prefix    string  `yaml:"prefix"`
}

Jump to

Keyboard shortcuts

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