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 ¶
var ( //URLData stores the urls mapped to app id URLData map[string][]string //to store the appids maped to urls //MQTTClient stores the Client object mapped to urls MQTTClient map[string]*Client //to store Homeedge client object for every url )
Functions ¶
func GetPublishedData ¶ added in v1.1.13
GetPublishedData is used to get the data for topic subscribed
func InitMQTTData ¶ added in v1.1.11
func InitMQTTData()
InitMQTTData creates an initialized hashmap
func NewTLSConfig ¶ added in v1.1.7
NewTLSConfig creates a tls config for mqtt client
Types ¶
type Client ¶
type Client struct { ID string Host string URL string Port uint Qos byte sync.RWMutex ClientOptions *MQTT.ClientOptions MQTT.Client // contains filtered or unexported fields }
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