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
- func (h *MQTTHandler) SendLocationNotification(payload handler.LocationNotification) error
- func (h *MQTTHandler) SendStatusNotification(payload handler.StatusNotification) 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"` StatusTopicTemplate string `mapstructure:"status_topic_template"` LocationTopicTemplate string `mapstructure:"location_topic_template"` UplinkRetainedMessage bool `mapstructure:"uplink_retained_message"` JoinRetainedMessage bool `mapstructure:"join_retained_message"` AckRetainedMessage bool `mapstructure:"ack_retained_message"` ErrorRetainedMessage bool `mapstructure:"error_retained_message"` StatusRetainedMessage bool `mapstructure:"status_retained_message"` LocationRetainedMessage bool `mapstructure:"location_retained_message"` }
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.
func (*MQTTHandler) SendLocationNotification ¶
func (h *MQTTHandler) SendLocationNotification(payload handler.LocationNotification) error
SendLocationNotification sends a LocationNotification.
func (*MQTTHandler) SendStatusNotification ¶
func (h *MQTTHandler) SendStatusNotification(payload handler.StatusNotification) error
SendStatusNotification sends a StatusNotification.
Click to show internal directories.
Click to hide internal directories.