server

package
v0.0.0-...-43f3d60 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONNECT    = 1
	CONNACK    = 2
	PUBLISH    = 3
	PUBACK     = 4
	SUBSCRIBE  = 8
	SUBACK     = 9
	DISCONNECT = 14
)

Constants for MQTT packet types

Variables

This section is empty.

Functions

This section is empty.

Types

type MQTTClient

type MQTTClient struct {
	ID      string
	Session quic.Connection
	Stream  quic.Stream
}

MQTTClient represents a connected MQTT client

type MessageEvent

type MessageEvent struct {
	Topic   string
	Payload []byte
	QoS     byte
}

MessageEvent represents a published message

type QUICBroker

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

QUICBroker is a simple MQTT broker using QUIC transport

func NewQUICBroker

func NewQUICBroker(addr string, insecure bool) (*QUICBroker, error)

NewQUICBroker creates a new MQTT broker using QUIC transport

func (*QUICBroker) Start

func (b *QUICBroker) Start() error

Start starts the MQTT broker

func (*QUICBroker) Stop

func (b *QUICBroker) Stop()

Stop gracefully stops the broker

Jump to

Keyboard shortcuts

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