Documentation ¶
Overview ¶
Package mqtt provides Gobot adaptor for the mqtt message service.
Installing:
go get github.com/hybridgroup/gobot/platforms/mqtt
For further information refer to mqtt README: https://github.com/hybridgroup/gobot/blob/master/platforms/mqtt/README.md
Index ¶
- type MqttAdaptor
- func (a *MqttAdaptor) Connect() (errs []error)
- func (a *MqttAdaptor) Disconnect() (err error)
- func (a *MqttAdaptor) Finalize() (errs []error)
- func (a *MqttAdaptor) Name() string
- func (a *MqttAdaptor) On(event string, f func(s []byte)) bool
- func (a *MqttAdaptor) Publish(topic string, message []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MqttAdaptor ¶
type MqttAdaptor struct { Host string // contains filtered or unexported fields }
func NewMqttAdaptor ¶
func NewMqttAdaptor(name string, host string, clientID string) *MqttAdaptor
NewMqttAdaptor creates a new mqtt adaptor with specified name, host and client id
func NewMqttAdaptorWithAuth ¶ added in v0.12.1
func NewMqttAdaptorWithAuth(name, host, clientID, username, password string) *MqttAdaptor
func (*MqttAdaptor) Connect ¶
func (a *MqttAdaptor) Connect() (errs []error)
Connect returns true if connection to mqtt is established
func (*MqttAdaptor) Disconnect ¶
func (a *MqttAdaptor) Disconnect() (err error)
Disconnect returns true if connection to mqtt is closed
func (*MqttAdaptor) Finalize ¶
func (a *MqttAdaptor) Finalize() (errs []error)
Finalize returns true if connection to mqtt is finalized successfully
func (*MqttAdaptor) Name ¶
func (a *MqttAdaptor) Name() string
Click to show internal directories.
Click to hide internal directories.