mqttClient

package
v2.8.4 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 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 Client

type Client interface {
	Name() string
	Run()
	Shutdown()
	ReplaceTemplate(template string) string
	AddRoute(subscribeTopic string, messageHandler MessageHandler)
}

type ClientPool

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

func RunPool

func RunPool() (pool *ClientPool)

func (*ClientPool) AddClient

func (p *ClientPool) AddClient(client Client)

func (*ClientPool) GetClientsByNames

func (p *ClientPool) GetClientsByNames(clientNames []string) (clients []Client)

func (*ClientPool) RemoveClient

func (p *ClientPool) RemoveClient(client Client)

func (*ClientPool) RunClients

func (p *ClientPool) RunClients()

func (*ClientPool) Shutdown

func (p *ClientPool) Shutdown()

type ClientStruct

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

func (*ClientStruct) AddRoute

func (c *ClientStruct) AddRoute(subscribeTopic string, messageHandler MessageHandler)

func (*ClientStruct) AvailabilityEnabled

func (c *ClientStruct) AvailabilityEnabled() bool

func (*ClientStruct) GetAvailabilityTopic

func (c *ClientStruct) GetAvailabilityTopic() string

func (*ClientStruct) Name

func (c *ClientStruct) Name() string

func (*ClientStruct) ReplaceTemplate

func (c *ClientStruct) ReplaceTemplate(template string) string

type ClientV3

type ClientV3 struct {
	ClientStruct
	// contains filtered or unexported fields
}

func CreateV3

func CreateV3(cfg Config, statistics Statistics) (client *ClientV3)

func (*ClientV3) Run

func (c *ClientV3) Run()

func (*ClientV3) Shutdown

func (c *ClientV3) Shutdown()

type ClientV5

type ClientV5 struct {
	ClientStruct
	// contains filtered or unexported fields
}

func CreateV5

func CreateV5(cfg Config, statistics Statistics) (client *ClientV5)

func (*ClientV5) Run

func (c *ClientV5) Run()

func (*ClientV5) Shutdown

func (c *ClientV5) Shutdown()

type Config

type Config interface {
	Name() string
	Broker() *url.URL
	User() string
	Password() string
	ClientId() string
	Qos() byte
	KeepAlive() time.Duration
	ConnectRetryDelay() time.Duration
	ConnectTimeout() time.Duration
	AvailabilityTopic() string
	TopicPrefix() string
	LogDebug() bool
	LogMessages() bool
}

type Message

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

func (Message) Payload

func (m Message) Payload() []byte

func (Message) Topic

func (m Message) Topic() string

type MessageHandler

type MessageHandler func(Message)

type Statistics

type Statistics interface {
	IncrementOne(module, name, field string)
}

Jump to

Keyboard shortcuts

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