Documentation ¶
Index ¶
- func OnInit(config map[string]interface{}, option ...Optionfn) (err error)
- func Publish(topic string, qos byte, retained bool, payload interface{}) mqtt.Token
- func Subscribe(topic string, qos byte, callback mqtt.MessageHandler) mqtt.Token
- type DefMqttDoor
- type IMqtt
- type IMqttDoor
- type Mqtt
- type Optionfn
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefMqttDoor ¶
type DefMqttDoor struct{}
func (*DefMqttDoor) ConnectHandler ¶
func (z *DefMqttDoor) ConnectHandler(client mqtt.Client)
连接的回掉函数
func (*DefMqttDoor) ConnectLostHandler ¶
func (z *DefMqttDoor) ConnectLostHandler(client mqtt.Client, err error)
丢失连接的回掉函数
func (*DefMqttDoor) MessageHandler ¶
func (z *DefMqttDoor) MessageHandler(client mqtt.Client, msg mqtt.Message)
创建全局 mqtt 消息处理 handler
type IMqtt ¶
type Optionfn ¶
type Optionfn func(*Options)
func SetClientID ¶
func SetMPassword ¶
func SetMqttAddr ¶
func SetMqttDoor ¶
func SetMqttPort ¶
func SetUserName ¶
Click to show internal directories.
Click to hide internal directories.