Documentation ¶
Overview ¶
Package mqtt implements a mqtt pub/sub interface
modules: MQTTMessage:
model: sour.is/x/toolbox/mqtt.GraphMessage
Index ¶
- func Dial(c *ConnectOptions) error
- func NewLogger(topic string, level event.Level) event.Logger
- func Publish(m Message) error
- func Subscribe(topic string, qos int8) (<-chan Message, func(), error)
- func Terminate()
- type Client
- type ConnectOptions
- type GraphMessage
- type GraphMqtt
- type Logger
- type Message
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { *client.Client Topics map[string][]chan<- Message // contains filtered or unexported fields }
Client holds a threadsafe client
var Default Client
Default shared connection to mqtt
type ConnectOptions ¶
type ConnectOptions = client.ConnectOptions
ConnectOptions defines options for connecting to mqtt
type GraphMessage ¶
GraphMessage returned to client
type GraphMqtt ¶
type GraphMqtt struct{}
GraphMqtt implements graphql resolver
type Logger ¶
Logger outputs an event to MQTT
func (*Logger) GetVerbose ¶
GetVerbose gets the verbose level
func (*Logger) SetVerbose ¶
SetVerbose sets the event verbose level
func (*Logger) WriteEvent ¶
WriteEvent ouputs an event to MQTT
Click to show internal directories.
Click to hide internal directories.