starter

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &BrokerConf{
	Addr:             "localhost:1883",
	Topics:           []string{"NOISE"},
	Username:         "admin",
	Password:         "public",
	ConnectTimeout:   0,
	FailureTimes:     5,
	MultipleTopicQoS: 1,
}

Functions

This section is empty.

Types

type Broker

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

func NewBroker

func NewBroker(conf *BrokerConf) Broker

func NewBrokerSimply

func NewBrokerSimply(addr string, topic string) Broker

func (Broker) Run

func (b Broker) Run(handle func(topic string, payload []byte))

func (Broker) Sub

func (b Broker) Sub(handle func(topic string, payload []byte))

type BrokerConf

type BrokerConf struct {
	Addr             string
	Topics           []string
	Username         string
	Password         string
	ConnectTimeout   int
	FailureTimes     int
	MultipleTopicQoS byte
}

func (BrokerConf) ClientID added in v0.7.0

func (c BrokerConf) ClientID() string

Jump to

Keyboard shortcuts

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