mqtt

package
v3.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: GPL-3.0 Imports: 3 Imported by: 29

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Client paho.Client

Functions

func Close

func Close()

func Open

func Open(cfg Options) 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

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

Jump to

Keyboard shortcuts

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