Documentation ¶
Index ¶
- func NewHandler(p *redis.Pool, c Config) (handler.Handler, error)
- type Config
- type MQTTHandler
- func (h *MQTTHandler) Close() error
- func (h *MQTTHandler) DataDownChan() chan handler.DataDownPayload
- func (h *MQTTHandler) SendACKNotification(payload handler.ACKNotification) error
- func (h *MQTTHandler) SendDataUp(payload handler.DataUpPayload) error
- func (h *MQTTHandler) SendErrorNotification(payload handler.ErrorNotification) error
- func (h *MQTTHandler) SendJoinNotification(payload handler.JoinNotification) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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"` JoinTopicTemplate string `mapstructure:"join_topic_template"` AckTopicTemplate string `mapstructure:"ack_topic_template"` ErrorTopicTemplate string `mapstructure:"error_topic_template"` }
Config holds the configuration for the MQTT handler.
type MQTTHandler ¶
type MQTTHandler struct {
// contains filtered or unexported fields
}
MQTTHandler implements a MQTT handler for sending and receiving data by an application.
func (*MQTTHandler) DataDownChan ¶
func (h *MQTTHandler) DataDownChan() chan handler.DataDownPayload
DataDownChan returns the channel containing the received DataDownPayload.
func (*MQTTHandler) SendACKNotification ¶
func (h *MQTTHandler) SendACKNotification(payload handler.ACKNotification) error
SendACKNotification sends an ACKNotification.
func (*MQTTHandler) SendDataUp ¶
func (h *MQTTHandler) SendDataUp(payload handler.DataUpPayload) error
SendDataUp sends a DataUpPayload.
func (*MQTTHandler) SendErrorNotification ¶
func (h *MQTTHandler) SendErrorNotification(payload handler.ErrorNotification) error
SendErrorNotification sends an ErrorNotification.
func (*MQTTHandler) SendJoinNotification ¶
func (h *MQTTHandler) SendJoinNotification(payload handler.JoinNotification) error
SendJoinNotification sends a JoinNotification.
Click to show internal directories.
Click to hide internal directories.