Documentation ¶
Index ¶
- func ClientIdGen(args ...interface{}) string
- type Client
- func (c *Client) Connect() (err error)
- func (c *Client) Disconnect()
- func (c *Client) IsConnected() bool
- func (c *Client) Publish(topic string, payload interface{}) (err error)
- func (c *Client) Subscribe(topic string, qos byte, callback MQTT.MessageHandler) (err error)
- func (c *Client) Unsubscribe(topic string) (err error)
- func (c *Client) UnsubscribeAll()
- type Config
- type Subscribe
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientIdGen ¶ added in v0.1.0
func ClientIdGen(args ...interface{}) string
Types ¶
type Client ¶
func (*Client) Disconnect ¶
func (c *Client) Disconnect()
func (*Client) IsConnected ¶
func (*Client) Unsubscribe ¶
func (*Client) UnsubscribeAll ¶
func (c *Client) UnsubscribeAll()
type Config ¶
type Config struct { KeepAlive int `json:"keep_alive"` PingTimeout int `json:"ping_timeout"` Broker string `json:"broker"` ClientID string `json:"client_id"` ConnectTimeout int `json:"connect_timeout"` CleanSession bool `json:"clean_session"` Username string `json:"username"` Password string `json:"password"` Qos byte `json:"qos"` }
type Subscribe ¶
type Subscribe struct { Qos byte Callback MQTT.MessageHandler }
Click to show internal directories.
Click to hide internal directories.