Documentation
¶
Overview ¶
Package mqtt provides Gobot adaptor for the mqtt message service.
Installing:
go get gobot.io/x/gobot/platforms/mqtt
For further information refer to mqtt README: https://github.com/hybridgroup/gobot/blob/master/platforms/mqtt/README.md
Index ¶
- type Adaptor
- func (a *Adaptor) Connect() (err error)
- func (a *Adaptor) Disconnect() (err error)
- func (a *Adaptor) Finalize() (err error)
- func (a *Adaptor) Name() string
- func (a *Adaptor) On(event string, f func(s []byte)) bool
- func (a *Adaptor) Publish(topic string, message []byte) bool
- func (a *Adaptor) SetName(n string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adaptor ¶
type Adaptor struct { Host string // contains filtered or unexported fields }
Adaptor is the Gobot Adaptor for MQTT
func NewAdaptor ¶
NewAdaptor creates a new mqtt adaptor with specified host and client id
func NewAdaptorWithAuth ¶
NewAdaptorWithAuth creates a new mqtt adaptor with specified host, client id, username, and password.
func (*Adaptor) Disconnect ¶
Disconnect returns true if connection to mqtt is closed
func (*Adaptor) On ¶
On subscribes to a topic, and then calls the message handler function when data is received
Click to show internal directories.
Click to hide internal directories.