Documentation ¶
Overview ¶
Package mqtt provides functionalities to handle the client connection to the broker using MQTT
Package mqtt provides functionalities to handle the client connection to the broker using MQTT
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitClientData ¶ added in v1.1.5
func InitClientData()
InitClientData creates an initialized hashmap
func StartMQTTClient ¶
StartMQTTClient is used to initiate the client and set the configuration
Types ¶
type Client ¶
type Client struct { ID string Host string URL string Port uint Qos byte sync.RWMutex ClientOptions *MQTT.ClientOptions MQTT.Client }
Client is a wrapper on top of `MQTT.Client`
func CheckifClientExist ¶ added in v1.1.5
CheckifClientExist used to check if the client conn object exist
func (*Client) Connect ¶
Connect creates a new mqtt client and uses the ClientOptions generated in the NewClient function to connect with the provided host and port.
func (*Client) Disconnect ¶ added in v1.1.4
Disconnect disconnects the connection
func (*Client) IsConnected ¶ added in v1.1.4
IsConnected checks if the client is connected or not
func (*Client) SetBrokerURL ¶
SetBrokerURL returns the broker url for connection