mqtt

package module
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const TwoHours = 119

Variables

This section is empty.

Functions

func NewProcessorRegistry added in v1.1.0

func NewProcessorRegistry() *processorRegistry

Types

type Exception

type Exception struct {
	Err   error
	Topic string
}

type Handler

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

func NewHandler

func NewHandler(opts Opts) (*Handler, error)

func (*Handler) AsyncProcess

func (h *Handler) AsyncProcess(ctx context.Context, topic string, numWorkers int,
	pf ProcessFunc,
) error

func (*Handler) Close

func (h *Handler) Close() (err error)

func (*Handler) GetExceptionChan

func (h *Handler) GetExceptionChan() <-chan Exception

func (*Handler) Publish

func (h *Handler) Publish(topic string, qos byte, retained bool,
	payload any, timeout time.Duration,
) (err error)

type Opts

type Opts struct {
	Broker   string `mapstructure:"broker" validate:"required"`
	Port     int    `mapstructure:"port" validate:"required"`
	ClientId string `mapstructure:"clientid" validate:"required"`
	Username string `mapstructure:"username" validate:"required"`
	Password string `mapstructure:"password" validate:"required"`
}

type ProcessFunc

type ProcessFunc func([]byte) error

Jump to

Keyboard shortcuts

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