mqtt

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinTopic

func JoinTopic(topics ...string) string

func SanitizeTopic

func SanitizeTopic(topic string) string

Types

type Connection

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

func Connect

func Connect(ctx context.Context, cfg cfg.Config) (*Connection, error)

func (*Connection) Disconnect

func (conn *Connection) Disconnect() error

func (*Connection) OnConnectionUp

func (conn *Connection) OnConnectionUp() <-chan struct{}

func (*Connection) OnError

func (conn *Connection) OnError() <-chan error

func (*Connection) OnMessage

func (conn *Connection) OnMessage() <-chan Data

func (*Connection) OnServerDisconnect

func (conn *Connection) OnServerDisconnect() <-chan struct{}

func (*Connection) Publish

func (conn *Connection) Publish(data Data)

func (*Connection) Subscribe

func (conn *Connection) Subscribe(topic string)

type Data

type Data struct {
	Topic string
	Data  []byte
}

Jump to

Keyboard shortcuts

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