gateway

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: EPL-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package gateway implements a MQTT-SN version 1.2 transparent gateway with optional DTLS encryption.

Index

Constants

This section is empty.

Variables

View Source
var Cancelled = errors.New("transaction cancelled")
View Source
var ErrIllegalPacketWhenDisconnected = errors.New("illegal packet in disconnected state")
View Source
var ErrMqttConnClosed = errors.New("MQTT broker closed connection")
View Source
var ErrTopicIDsExhausted = errors.New("no more TopicIDs available")
View Source
var Shutdown = errors.New("clean shutdown")

This error is used to shut down the handler from a goroutine. It does not signalize error.

Functions

This section is empty.

Types

type Gateway

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

func NewGateway

func NewGateway(log util.Logger, cfg *GatewayConfig) *Gateway

func (*Gateway) ListenAndServe

func (gw *Gateway) ListenAndServe(ctx context.Context, address string) error

ListenAndServe starts a gateway listening on the given address. It returns only on fatal internal errors or when the given context is canceled.

type GatewayConfig

type GatewayConfig struct {
	MqttBrokerAddress     *net.TCPAddr
	MqttConnectionTimeout time.Duration
	MqttUser              *string
	MqttPassword          []byte
	UseDTLS               bool
	SelfSigned            bool
	Certificate           *tls.Certificate
	PrivateKey            crypto.PrivateKey
	PerformanceLogTime    time.Duration
	PredefinedTopics      topics.PredefinedTopics
	AuthEnabled           bool
	// TRetry in MQTT-SN specification
	RetryDelay time.Duration
	// NRetry in MQTT-SN specification
	RetryCount uint
}

Jump to

Keyboard shortcuts

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