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
type GatewayConfig ¶
type GatewayConfig struct {
MqttBrokerAddress *net.TCPAddr
MqttConnectionTimeout time.Duration
MqttUser *string
MqttPassword []byte
// UsePSK controls whether pre-shared key should be used to secure the
// connection to the MQTT-SN gateway. If UsePSK is true, you must provide
// PSKIdentityHint, PSKAPIBasicAuthUsername, PSKAPIBasicAuthPassword and
// PSKAPIEndpoint.
// If UsePSK is true, the client will use PSKKeys instead of the certificate
// and private key.
UsePSK bool
PSKKeys *cache.Cache
PSKCacheExpiration time.Duration
PSKIdentityHint string
PSKAPITimeout time.Duration
PSKAPIBasicAuthUsername string
PSKAPIBasicAuthPassword string
PSKAPIEndpoint string
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
}
Click to show internal directories.
Click to hide internal directories.