mqttclient

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MqttService

type MqttService struct {
	Endpoint      string
	User          string
	Password      string
	ClientID      string
	Cleansession  bool
	AutoReconnect bool
	Qos           byte
	TlsConfig     *TlsConfig

	Logger *zap.Logger
	Client mqtt.Client
	// contains filtered or unexported fields
}

func InitMqtt

func InitMqtt(logger *zap.Logger) (*MqttService, error)

func NewMQTTClient added in v0.11.0

func NewMQTTClient(logger *zap.Logger, broke *MqttService, subKey string) (*MqttService, error)

func (*MqttService) LogMessage

func (m *MqttService) LogMessage(c mqtt.Client, msg mqtt.Message)

func (*MqttService) OnConnect

func (m *MqttService) OnConnect(c mqtt.Client)

func (*MqttService) Pub added in v0.10.18

func (m *MqttService) Pub(topic string, qos byte, retained bool, payload any) error

func (*MqttService) StartHeartbeat added in v0.10.18

func (m *MqttService) StartHeartbeat(serviceNmae, hbSchedule string)

func (*MqttService) Sub

func (m *MqttService) Sub(topic string, handle mqtt.MessageHandler) error

type TlsConfig added in v0.10.14

type TlsConfig struct {
	Ca   string
	Key  string
	Cert string
}

Jump to

Keyboard shortcuts

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