mqtt

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 integration.

type Integration

type Integration struct {
	// contains filtered or unexported fields
}

Integration implements a MQTT integration.

func New

func New(p *redis.Pool, conf Config) (*Integration, error)

New creates a new MQTT integration.

func (*Integration) Close

func (i *Integration) Close() error

Close stops the handler.

func (*Integration) DataDownChan

func (i *Integration) DataDownChan() chan integration.DataDownPayload

DataDownChan returns the channel containing the received DataDownPayload.

func (*Integration) SendACKNotification

func (i *Integration) SendACKNotification(ctx context.Context, payload integration.ACKNotification) error

SendACKNotification sends an ACKNotification.

func (*Integration) SendDataUp

func (i *Integration) SendDataUp(ctx context.Context, payload integration.DataUpPayload) error

SendDataUp sends a DataUpPayload.

func (*Integration) SendErrorNotification

func (i *Integration) SendErrorNotification(ctx context.Context, payload integration.ErrorNotification) error

SendErrorNotification sends an ErrorNotification.

func (*Integration) SendJoinNotification

func (i *Integration) SendJoinNotification(ctx context.Context, payload integration.JoinNotification) error

SendJoinNotification sends a JoinNotification.

func (*Integration) SendLocationNotification

func (i *Integration) SendLocationNotification(ctx context.Context, payload integration.LocationNotification) error

SendLocationNotification sends a LocationNotification.

func (*Integration) SendStatusNotification

func (i *Integration) SendStatusNotification(ctx context.Context, payload integration.StatusNotification) error

SendStatusNotification sends a StatusNotification.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL