mqtt

package
v0.0.0-...-0cd63e0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: GPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectHandler

func ConnectHandler(logger zerolog.Logger) func(client pmqtt.Client)

func ConnectLostHandler

func ConnectLostHandler(logger zerolog.Logger) func(client pmqtt.Client, err error)

Types

type Mqtt

type Mqtt struct {
	Topic  string
	MgtUrl string

	ClientID uuid.UUID
	// contains filtered or unexported fields
}

func NewMqtt

func NewMqtt(conf MqttConf, logl int, ctx context.Context) (*Mqtt, error)

func (*Mqtt) Connect

func (m *Mqtt) Connect() error

func (*Mqtt) ConnectHandler

func (m *Mqtt) ConnectHandler() func(client pmqtt.Client)

func (*Mqtt) ConnectLostHandler

func (m *Mqtt) ConnectLostHandler() func(client pmqtt.Client, err error)

func (*Mqtt) Disconnect

func (m *Mqtt) Disconnect()

func (*Mqtt) SendAlarm

func (m *Mqtt) SendAlarm(events []model.FCTSDataModel) error

type MqttConf

type MqttConf struct {
	Connection string `yaml:"Connection"`
	Topic      string `yaml:"Topic"`
}

Jump to

Keyboard shortcuts

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