Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Mqtt ¶
type Mqtt struct { Topic string MgtUrl string ClientID uuid.UUID // contains filtered or unexported fields }
Mqtt represents an MQTT client.
func (*Mqtt) ConnectHandler ¶
ConnectHandler returns a function to handle successful connections to the MQTT broker. The returned function logs an informational message indicating a successful connection.
func (*Mqtt) ConnectLostHandler ¶
ConnectLostHandler returns a function to handle lost connections to the MQTT broker. The returned function logs a warning message indicating a lost connection along with the error encountered.
func (*Mqtt) Disconnect ¶
func (m *Mqtt) Disconnect()
Disconnect terminates the connection to the MQTT broker and logs the disconnection event.
func (*Mqtt) SendAlarm ¶
SendAlarm sends a list of FCTSDataModel events to the MQTT broker and logs any errors that occur during the process.
func (*Mqtt) SendAlarmRaw ¶
SendAlarmRaw sends a raw alarm message to the MQTT broker and returns an error if the sending fails.