mqttclient

package
v0.10.14 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 11 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 NewMqttOptions added in v0.10.14

func NewMqttOptions(logger *zap.Logger) (*mqtt.ClientOptions, *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) Sub

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

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