Documentation
¶
Index ¶
- 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 ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
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.