mqttClient

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v1.3.0

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

type ClientPool added in v1.3.0

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

func RunPool added in v1.3.0

func RunPool() (pool *ClientPool)

func (*ClientPool) AddClient added in v1.3.0

func (p *ClientPool) AddClient(client Client)

func (*ClientPool) GetClientsByNames added in v1.7.0

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

func (*ClientPool) RemoveClient added in v1.3.0

func (p *ClientPool) RemoveClient(client Client)

func (*ClientPool) RunClients added in v1.7.0

func (p *ClientPool) RunClients()

func (*ClientPool) Shutdown added in v1.3.0

func (p *ClientPool) Shutdown()

type ClientStruct added in v1.3.0

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

func (*ClientStruct) AddRoute added in v1.7.0

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

func (*ClientStruct) AvailabilityEnabled added in v1.7.0

func (c *ClientStruct) AvailabilityEnabled() bool

func (*ClientStruct) GetAvailabilityTopic added in v1.7.0

func (c *ClientStruct) GetAvailabilityTopic() string

func (*ClientStruct) Name added in v1.7.0

func (c *ClientStruct) Name() string

func (*ClientStruct) ReplaceTemplate added in v1.7.0

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

type ClientV5 added in v1.7.0

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

func CreateV5 added in v1.7.0

func CreateV5(
	cfg Config,
	devicePoolInstance *device.DevicePool,
	storage *dataflow.ValueStorageInstance,
) (client *ClientV5)

func (*ClientV5) Run added in v1.7.0

func (c *ClientV5) Run()

func (*ClientV5) Shutdown added in v1.7.0

func (c *ClientV5) Shutdown()

type Config added in v1.3.0

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
	TelemetryInterval() time.Duration
	TelemetryTopic() string
	TelemetryRetain() bool
	RealtimeEnable() bool
	RealtimeTopic() string
	RealtimeRetain() bool
	TopicPrefix() string
	LogDebug() bool
	LogMessages() bool
}

type Message added in v1.7.0

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

func (Message) Payload added in v1.7.0

func (m Message) Payload() []byte

func (Message) Topic added in v1.7.0

func (m Message) Topic() string

type MessageHandler added in v1.7.0

type MessageHandler func(Message)

type NumericRealtimeMessage added in v1.3.0

type NumericRealtimeMessage struct {
	Time         string
	NumericValue float64
	Unit         string
}

type NumericTelemetryValue added in v1.3.0

type NumericTelemetryValue struct {
	Value float64
	Unit  string
}

type TelemetryMessage

type TelemetryMessage struct {
	Time                   string
	NextTelemetry          string
	Model                  string
	SecondsSinceLastUpdate float64
	NumericValues          map[string]NumericTelemetryValue
	TextValues             map[string]TextTelemetryValue
}

type TextRealtimeMessage added in v1.3.0

type TextRealtimeMessage struct {
	Time      string
	TextValue string
}

type TextTelemetryValue added in v1.3.0

type TextTelemetryValue struct {
	Value string
}

Jump to

Keyboard shortcuts

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