iothubmqtt

package
v0.0.0-...-d15b5f8 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Broker   string
	Port     int
	ClientID string
	Username string
	Password string
}

func BuildConfigFromEnv

func BuildConfigFromEnv(prefix string) (*Config, error)

type MQTTClient

type MQTTClient interface {
	Configure()
	OnConnect(func(mqtt.Client))
	OnConnectionLost(func(mqtt.Client, error))
	Connect() error
	IsConnected() bool
	Configuration() Config

	Publish(topic, message string) error
	Subscribe(topic string, qos byte, callback mqtt.MessageHandler) mqtt.Token
}

func NewMQTTClient

func NewMQTTClient(config *Config) MQTTClient

Jump to

Keyboard shortcuts

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