mqtt

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

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

Broker is a simple mqtt publisher abstraction.

func NewBroker

func NewBroker(bindAddress string, wsPort int, wsPath string, workerCount int, onSubscribe OnSubscribeHandler, onUnsubscribe OnUnsubscribeHandler, cleanupThreshold int) (*Broker, error)

NewBroker creates a new broker.

func (*Broker) Config

func (b *Broker) Config() *broker.Config

Config returns the broker config instance.

func (*Broker) HasSubscribers

func (b *Broker) HasSubscribers(topic string) bool

func (*Broker) Send

func (b *Broker) Send(topic string, payload []byte)

Send publishes a message.

func (*Broker) Start

func (b *Broker) Start()

Start the broker.

func (*Broker) TopicsManagerSize

func (b *Broker) TopicsManagerSize() int

TopicsManagerSize returns the size of the underlying map of the topics manager.

type OnSubscribeHandler

type OnSubscribeHandler func(topic []byte)

type OnUnsubscribeHandler

type OnUnsubscribeHandler func(topic []byte)

Jump to

Keyboard shortcuts

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