server

package
v0.0.0-...-80ab217 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 12 Imported by: 1

Documentation

Overview

Package server implements a simple MQTT server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(s *server)

Option for the server

func WithAuth

func WithAuth(iface auth.Interface) Option

WithAuth returns an option that sets the authentication

func WithIPLimits

func WithIPLimits(max int) Option

WithIPLimits returns an option that sets limits on connections per IP

func WithSessionStore

func WithSessionStore(sess session.Store) Option

WithSessionStore returns an option that sets store for sessions

func WithUserLimits

func WithUserLimits(max int) Option

WithUserLimits returns an option that sets limits on connections per User

type Server

type Server interface {
	Sessions() session.Store
	Publish(pkt *packet.PublishPacket)
	Handle(conn mqttnet.Conn)
}

Server interface

func New

func New(ctx context.Context, option ...Option) Server

New returns a new MQTT server

Jump to

Keyboard shortcuts

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