Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneOptions ¶
func CloneOptions(o *mqtt.ClientOptions) *mqtt.ClientOptions
CloneOptions creates a copy of the relevant mqtt options. It is used to create a per-device MQTT connection from template options. This is needed to satisfy the Homie spec which requires a dedicated connection to apply the last will to.
Types ¶
type ErrorHandler ¶
type ErrorHandler func(err error)
ErrorHandler is the type MQTT error handlers must implement
type Handler ¶
type Handler struct { Client mqtt.Client Timeout time.Duration ErrorHandler ErrorHandler // contains filtered or unexported fields }
Handler is the MQTT adapter for Eclipse Paho
func NewHandler ¶
func NewHandler(deviceRoot string, template *mqtt.ClientOptions, qos byte) *Handler
NewHandler creates a new MQTT client connection with applied last will
Click to show internal directories.
Click to hide internal directories.