Documentation ¶
Index ¶
- func NewHandlerClimate(_ context.Context, logger *zap.Logger) mqtt.MessageHandler
- func NewHandlerSystem(_ context.Context, logger *zap.Logger) mqtt.MessageHandler
- func NewMQTTClient(cfg MQTTConfig, logger *zap.Logger) (mqtt.Client, error)
- func StartConsumer(mqttClient mqtt.Client, topic string, messageHandler mqtt.MessageHandler) error
- type Config
- type MQTTConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandlerClimate ¶
func NewHandlerSystem ¶
func NewMQTTClient ¶
func StartConsumer ¶
Types ¶
type Config ¶
type Config struct { MQTTConfig core.LoggerConfig }
type MQTTConfig ¶
type MQTTConfig struct { Server string `envconfig:"MQTT_HOST" default:"tcp://127.0.0.1:1883"` ClientID string `envconfig:"MQTT_CLIENT_ID" default:"meteo-collector"` TopicSensors string `envconfig:"MQTT_TOPIC_SENSORS" default:"climate/#"` TopicSystem string `envconfig:"MQTT_TOPIC_SYSTEM" default:"sys/#"` ConnectTimeout time.Duration `envconfig:"MQTT_CONNECT_TIMEOUT" default:"3s"` DisconnectTimeout time.Duration `envconfig:"MQTT_DISCONNECT_TIMEOUT" default:"3s"` }
Click to show internal directories.
Click to hide internal directories.