mqttClient

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OfflinePayload string = "Offline"
	OnlinePayload  string = "Online"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	Name() string
	Broker() string
	User() string
	Password() string
	ClientId() string
	Qos() byte
	AvailabilityTopic() string
	TopicPrefix() string
	LogMessages() bool
}

type MqttClient

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

func Run

func Run(config Config, statistics Statistics) (*MqttClient, error)

func (*MqttClient) Name

func (mq *MqttClient) Name() string

func (*MqttClient) Shutdown

func (mq *MqttClient) Shutdown()

func (*MqttClient) Subscribe

func (mq *MqttClient) Subscribe(topic string, callback mqtt.MessageHandler) error

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