repositorypackage
1.0.0
Repository: https://github.com/mhazley/go_mqtt_client.git
Documentation: pkg.go.dev
# README
mqttClient: a Go module
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.
Customizing your broker
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()
Tests
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.