Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cembdc/go-mqtt-sample
https://github.com/cembdc/go-mqtt-sample
go go-mqtt golang golang-examples mqtt mqtt-client mqtt-server
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cembdc/go-mqtt-sample
- Owner: cembdc
- Created: 2024-06-30T10:32:24.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-06-30T10:58:12.000Z (7 months ago)
- Last Synced: 2024-11-04T11:23:06.977Z (3 months ago)
- Topics: go, go-mqtt, golang, golang-examples, mqtt, mqtt-client, mqtt-server
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MQTT Publisher/Subscriber
## Publisher
The publisher code publishes temperature, humidity, and light data at specific intervals using the MQTT protocol. A Publisher object is created for each data type, and messages are sent to the MQTT server by calling the publishMessage function with these objects. The newTLSConfig function is also defined to establish a secure connection using TLS.## Subscriber
This code listens to temperature, humidity, and light data using the MQTT protocol. The SubscriberClient struct contains subscription information and topics. The subscribe function subscribes to specific topics and prints the messages to the console. The newTLSConfig function is also defined to establish a secure connection using TLS.