This is a go module to facilitate the use of MQTT clients by
- applying defaults
- handling errors
- printing helpful logs
- asynchronously publishing payloads
All of this allows for neater and non-repetitive code.
If you want to add or modify the broker options, you can access and modify MqttClient.Options
before calling
StartMqttClient
. Example;
client := MqttClientInit(myHandlerFunction, mySubTopics, broker)
client.Options.SetClientID("myId")
client.StartMqttClient()
To run the tests simply execute go test
from the root directory. Pass the -v
flag to see all executed tests, not
just the failed ones.
To see info
and debug
logs pass the --debug
flag.
To see logs in a human friendly way pass the --human
flag.