Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMessageChannel ¶
Types ¶
type MQTTClient ¶
type MQTTClient struct { Client mqtt.Client Config MQTTConfig // contains filtered or unexported fields }
MQTTClient is the interface for the MQTT client
func NewMQTTClient ¶
func NewMQTTClient(config MQTTConfig) *MQTTClient
func (*MQTTClient) Connect ¶
func (m *MQTTClient) Connect() error
func (*MQTTClient) Disconnect ¶
func (m *MQTTClient) Disconnect()
func (*MQTTClient) Subscribe ¶
func (m *MQTTClient) Subscribe() error
type MQTTConfig ¶
type MQTTConfig struct { Broker string Port int ClientID string Topic string Qos byte CleanSession bool KeepAlive int ReconnectOnDisconnect bool Username string Password string }
MQTTConfig is the configuration for the MQTT client
type MessageQueue ¶
type MessageQueue struct {
// contains filtered or unexported fields
}
MessageQueue handles queuing and processing messages
func NewMessageQueue ¶
func NewMessageQueue(bufferSize int, workers int) *MessageQueue
NewMessageQueue creates a new message queue with a specified buffer size
func (*MessageQueue) Enqueue ¶
func (mq *MessageQueue) Enqueue(msg mqtt.Message)
Enqueue adds a message to the queue
func (*MessageQueue) StartProcessing ¶
func (mq *MessageQueue) StartProcessing(handler func(mqtt.Message))
StartProcessing starts worker goroutines to process messages from the queue
func (*MessageQueue) StopProcessing ¶
func (mq *MessageQueue) StopProcessing()
StopProcessing signals workers to stop and waits for them to finish
Click to show internal directories.
Click to hide internal directories.