mqtt

package
v0.0.0-...-d0700b5 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RxDiscoveryMQTT is events topic where service put received MQTT messages from discovery topic
	RxDiscoveryMQTT = "mqtt:discovery"
	// RxTelemetryMQTT is events topic where service put received MQTT messages from telemetry topic
	RxTelemetryMQTT = "mqtt:telemetry"
	// RxCommandsMQTT is events topic where service put received MQTT messages from command topic
	RxCommandsMQTT = "mqtt:commands"
	// RxStatusesMQTT is events topic where service put received MQTT messages from status topic
	RxStatusesMQTT = "mqtt:statuses"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventMQTT

type EventMQTT struct {
	Topic   []string
	Payload []byte
}

EventMQTT is MQTT event content

func NewEventMQTT

func NewEventMQTT(topic string, payload []byte) EventMQTT

NewEventMQTT return internal MQTT event representation

type Service

type Service struct {
	runnable.Runnable
	// contains filtered or unexported fields
}

Service is MQTT client service implementation

func NewService

func NewService(bus eventbus.Bus) (service *Service, e error)

NewService return new service implementation example: https://levelup.gitconnected.com/how-to-use-mqtt-with-go-89c617915774 Official documentation: https://www.emqx.com/en/blog/how-to-use-mqtt-in-golang Tasmota MQTT: https://tasmota.github.io/docs/MQTT/#command-flow

func (*Service) Run

func (service *Service) Run(ctx context.Context) error

Run is implementation of runnable.Runnable interface

Jump to

Keyboard shortcuts

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