mqtt

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(mqtt *Mqtt, name string) mqttType.MqttCli

NewClient ...

func NewMqtt

func NewMqtt(lc fx.Lifecycle,
	cfg *Config,
	authenticator mqttType.MqttAuthenticator,
	scriptService scripts.ScriptService,
	eventBus bus.Bus) (mqtt mqttType.MqttServ)

NewMqtt ...

Types

type Admin

type Admin interface {
	GetClients(limit, offset uint) (list []*admin.ClientInfo, total uint32, err error)
	GetClient(clientId string) (client *admin.ClientInfo, err error)
	GetSessions(limit, offset uint) (list []*admin.SessionInfo, total int, err error)
	GetSession(clientId string) (session *admin.SessionInfo, err error)
	GetSubscriptions(clientId string, limit, offset uint) (list []*admin.SubscriptionInfo, total int, err error)
	Subscribe(clientId, topic string, qos int) (err error)
	Unsubscribe(clientId, topic string) (err error)
	Publish(topic string, qos int, payload []byte, retain bool) (err error)
	CloseClient(clientId string) (err error)
	SearchTopic(query string) (result []*admin.SubscriptionInfo, err error)
}

Admin ...

type Config

type Config struct {
	Port                       int
	RetryInterval              time.Duration
	RetryCheckInterval         time.Duration
	SessionExpiryInterval      time.Duration
	SessionExpireCheckInterval time.Duration
	QueueQos0Messages          bool
	MaxInflight                int
	MaxAwaitRel                int
	MaxMsgQueue                int
	Logging                    bool
	DebugMode                  common.RunMode
}

Config ...

type Mqtt

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

Mqtt ...

func (*Mqtt) Admin

func (m *Mqtt) Admin() Admin

Admin ...

func (*Mqtt) Authenticator

func (m *Mqtt) Authenticator() mqttType.MqttAuthenticator

Authenticator ...

func (*Mqtt) NewClient

func (m *Mqtt) NewClient(name string) (client mqttType.MqttCli)

NewClient ...

func (*Mqtt) Publish

func (m *Mqtt) Publish(topic string, payload []byte, qos uint8, retain bool) (err error)

Publish ...

func (*Mqtt) RemoveClient

func (m *Mqtt) RemoveClient(name string)

RemoveClient ...

func (*Mqtt) Shutdown

func (m *Mqtt) Shutdown() (err error)

Shutdown ...

func (*Mqtt) Start

func (m *Mqtt) Start()

Start ...

type MqttBind

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

MqttBind ...

func NewMqttBind

func NewMqttBind(mqtt mqtt2.MqttServ) *MqttBind

NewMqttBind ...

func (MqttBind) Publish

func (m MqttBind) Publish(topic string, payload []byte, qos uint8, retain bool)

Publish ...

type MqttServAdmin

type MqttServAdmin interface {
	Admin() Admin
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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