mqtt

package
v3.2.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: GPL-3.0 Imports: 5 Imported by: 29

Documentation

Index

Constants

View Source
const ENV = "IOT_MASTER_MQTT_"

Variables

View Source
var Client paho.Client

Functions

func Close

func Close()

func Load added in v3.1.0

func Load() error

func Open

func Open() error

func OpenBy

func OpenBy(fn paho.OpenConnectionFunc) error

func Publish

func Publish(topic string, payload []byte, retain bool, qos byte) error

func PublishJson

func PublishJson(topic string, payload any) error

func SetOptions added in v3.1.0

func SetOptions(opts Options)

func Store added in v3.1.0

func Store() error

Types

type Options

type Options struct {
	Url      string `json:"url,omitempty"`
	ClientId string `json:"clientId,omitempty"`
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

func Default

func Default() Options

func GetOptions added in v3.1.0

func GetOptions() Options

func (*Options) FromEnv added in v3.1.0

func (options *Options) FromEnv()

func (*Options) ToEnv added in v3.1.0

func (options *Options) ToEnv() []string

Jump to

Keyboard shortcuts

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