mqtt

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 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) (*Broker, error)

NewBroker creates a new broker.

func (*Broker) GetConfig

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

GetConfig 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.

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