Documentation ¶
Index ¶
- func NewBackend(redisPool *redis.Pool, c Config) (backend.Gateway, error)
- type Backend
- func (b *Backend) Close() error
- func (b *Backend) DownlinkTXAckChan() chan gw.DownlinkTXAck
- func (b *Backend) RXPacketChan() chan gw.UplinkFrame
- func (b *Backend) SendGatewayConfigPacket(configPacket gw.GatewayConfiguration) error
- func (b *Backend) SendTXPacket(txPacket gw.DownlinkFrame) error
- func (b *Backend) StatsPacketChan() chan gw.GatewayStats
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
Backend implements a MQTT pub-sub backend.
func (*Backend) Close ¶
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 (*Backend) DownlinkTXAckChan ¶
func (b *Backend) DownlinkTXAckChan() chan gw.DownlinkTXAck
DownlinkTXAckChan returns the downlink tx ack channel.
func (*Backend) RXPacketChan ¶
func (b *Backend) RXPacketChan() chan gw.UplinkFrame
RXPacketChan returns the uplink-frame channel.
func (*Backend) SendGatewayConfigPacket ¶
func (b *Backend) SendGatewayConfigPacket(configPacket gw.GatewayConfiguration) error
SendGatewayConfigPacket sends the given GatewayConfigPacket to the gateway.
func (*Backend) SendTXPacket ¶
func (b *Backend) SendTXPacket(txPacket gw.DownlinkFrame) error
SendTXPacket sends the given downlink-frame to the gateway.
func (*Backend) StatsPacketChan ¶
func (b *Backend) StatsPacketChan() chan gw.GatewayStats
StatsPacketChan returns the gateway stats channel.
type Config ¶
type Config 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"` }
Config holds the MQTT backend configuration.
Click to show internal directories.
Click to hide internal directories.