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 ¶ added in v1.0.0
type Adaptor struct { Host string // contains filtered or unexported fields }
Adaptor is the Gobot Adaptor for MQTT
func NewAdaptor ¶ added in v1.0.0
NewAdaptor creates a new mqtt adaptor with specified host and client id
func NewAdaptorWithAuth ¶ added in v1.0.0
NewAdaptorWithAuth creates a new mqtt adaptor with specified host, client id, username, and password.
func (*Adaptor) Disconnect ¶ added in v1.0.0
Disconnect returns true if connection to mqtt is closed
func (*Adaptor) Finalize ¶ added in v1.0.0
Finalize returns true if connection to mqtt is finalized successfully
func (*Adaptor) On ¶ added in v1.0.0
On subscribes to a topic, and then calls the message handler function when data is received