mqtt

package
v0.0.0-...-65bfcca Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	ID     string
	Config *model.MQTTConfig
	Client paho.Client
	// contains filtered or unexported fields
}

Endpoint data

func New

func New(ID string, cfg *model.MQTTConfig, rxFunc func(msg *model.Message)) (*Endpoint, error)

New mqtt driver

func (*Endpoint) Close

func (ep *Endpoint) Close() error

Close the driver

func (*Endpoint) Subscribe

func (ep *Endpoint) Subscribe(topic string) error

Subscribe a topic

func (*Endpoint) Write

func (ep *Endpoint) Write(msg *model.Message) error

Write publishes a payload

Jump to

Keyboard shortcuts

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