Documentation ¶
Index ¶
- func NewMQTTBackend(redisPool *redis.Pool, c MQTTBackendConfig) (backend.Gateway, error)
- type MQTTBackend
- func (b *MQTTBackend) Close() error
- func (b *MQTTBackend) RXPacketChan() chan gw.RXPacket
- func (b *MQTTBackend) SendGatewayConfigPacket(configPacket gw.GatewayConfigPacket) error
- func (b *MQTTBackend) SendTXPacket(txPacket gw.TXPacket) error
- func (b *MQTTBackend) StatsPacketChan() chan gw.GatewayStatsPacket
- type MQTTBackendConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMQTTBackend ¶
NewMQTTBackend creates a new Backend.
Types ¶
type MQTTBackend ¶
type MQTTBackend struct {
// contains filtered or unexported fields
}
MQTTBackend implements a MQTT pub-sub backend.
func (*MQTTBackend) Close ¶
func (b *MQTTBackend) Close() error
Close closes the backend. Note that this closes the backend one-way (gateway to backend). This makes it possible to perform a graceful shutdown (e.g. when there are still packets to send back to the gateway).
func (*MQTTBackend) RXPacketChan ¶
func (b *MQTTBackend) RXPacketChan() chan gw.RXPacket
RXPacketChan returns the RXPacket channel.
func (*MQTTBackend) SendGatewayConfigPacket ¶
func (b *MQTTBackend) SendGatewayConfigPacket(configPacket gw.GatewayConfigPacket) error
SendGatewayConfigPacket sends the given GatewayConfigPacket to the gateway.
func (*MQTTBackend) SendTXPacket ¶
func (b *MQTTBackend) SendTXPacket(txPacket gw.TXPacket) error
SendTXPacket sends the given TXPacket to the gateway.
func (*MQTTBackend) StatsPacketChan ¶
func (b *MQTTBackend) StatsPacketChan() chan gw.GatewayStatsPacket
StatsPacketChan returns the gateway stats channel.
type MQTTBackendConfig ¶
type MQTTBackendConfig struct { Server string Username string Password string QOS uint8 `mapstructure:"qos"` CleanSession bool `mapstructure:"clean_session"` ClientID string `mapstructure:"client_id"` CACert string `mapstructure:"ca_cert"` TLSCert string `mapstructure:"tls_cert"` TLSKey string `mapstructure:"tls_key"` UplinkTopicTemplate string `mapstructure:"uplink_topic_template"` DownlinkTopicTemplate string `mapstructure:"downlink_topic_template"` StatsTopicTemplate string `mapstructure:"stats_topic_template"` AckTopicTemplate string `mapstructure:"ack_topic_template"` ConfigTopicTemplate string `mapstructure:"config_topic_template"` }
MQTTBackendConfig holds the MQTT backend configuration.
Click to show internal directories.
Click to hide internal directories.