mqtt

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MqttConf

type MqttConf struct {
	TCP           string `yaml:"tcp"`
	CaFile        string `yaml:"ca"`
	ClientCrt     string `yaml:"crt"`
	ClientKey     string `yaml:"key"`
	UserName      string `yaml:"user"`
	Password      string `yaml:"password"`
	FileStorePath string `yaml:"fileStorePath"`
}

func (*MqttConf) NewMqttServ

func (mm *MqttConf) NewMqttServ(serviceID string, l log.Logger) (MqttServ, error)

func (*MqttConf) NewMqttServWithFileStore

func (mm *MqttConf) NewMqttServWithFileStore(serviceID, clientID string, l log.Logger) (MqttServ, error)

type MqttDI

type MqttDI interface {
	NewMqttServ(serviceID string, l log.Logger) (MqttServ, error)
	NewMqttServWithFileStore(serviceID, clientID string, l log.Logger) (MqttServ, error)
}

type MqttServ

type MqttServ interface {
	PublishByte(topics []string, data []byte, retain bool) error
	Publish(topics []string, message map[string]interface{}, retain bool) error
	Subcribe(mssm MqttSubSerInter) error
	SubscribeMultiple(mssm MqttSubSerMap) error
	Disconnect()
	// contains filtered or unexported methods
}

type MqttSubSerInter

type MqttSubSerInter interface {
	GetTopic() string
	GetQos() byte
	Handler(client mqtt.Client, msg mqtt.Message)
}

type MqttSubSerMap

type MqttSubSerMap struct {
	// contains filtered or unexported fields
}

func (*MqttSubSerMap) Add

func (mssl *MqttSubSerMap) Add(mss MqttSubSerInter)

func (MqttSubSerMap) GetSubscribeMap

func (mssl MqttSubSerMap) GetSubscribeMap() map[string]byte

func (MqttSubSerMap) Handler

func (mssl MqttSubSerMap) Handler(client mqtt.Client, message mqtt.Message)

Jump to

Keyboard shortcuts

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