messaging

package
v0.0.0-...-33e8507 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapHandler

func WrapHandler[T any](handler func(T)) MQTT.MessageHandler

Types

type MQTTClient

type MQTTClient struct {
	// contains filtered or unexported fields
}

func StartMQTTClient

func StartMQTTClient(url, port, clientID string) MQTTClient

func (*MQTTClient) Close

func (c *MQTTClient) Close()

func (*MQTTClient) SendMessage

func (c *MQTTClient) SendMessage(topic string, message string)

func (*MQTTClient) SubscribeToThermostat

func (c *MQTTClient) SubscribeToThermostat(topic string, handler func(models.SensorState))

func (*MQTTClient) SubscribeToValves

func (c *MQTTClient) SubscribeToValves(topic string, handler func(map[string]any))

type MessageClient

type MessageClient interface {
	Close()
	SendMessage(topic string, message string)
	SubscribeToThermostat(topic string, handler func(models.SensorState))
	SubscribeToValves(topic string, handler func(map[string]any))
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL