mqtt

package
v0.0.0-...-332c7e9 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package mqtt provides an MQTT broker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr               string            `name:"address" description:"server address"`
	Debug              bool              `name:"debug" description:"enable debug mode"`
	Auth               auth.Config       `name:"auth" description:"authentication configuration"`
	AllowedTopicPrefix map[string]string `name:"allowed-topic-prefix" description:"allowed topic prefix per username"`
}

Config is the configuration for the MQTT server.

type Message

type Message struct {
	Username string
	Topic    string
	Payload  []byte
}

Message is a message received on the MQTT server.

type Server

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

Server is an MQTT server.

func New

func New(ctx context.Context, c Config, messagesCh chan *Message) (*Server, error)

New creates a new Server.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start starts the MQTT server.

Jump to

Keyboard shortcuts

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