mqtt

package module
v0.0.0-...-6f9e92a Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct {
}

func (*Factory) Metadata

func (*Factory) Metadata() *trigger.Metadata

func (*Factory) New

func (*Factory) New(config *trigger.Config) (trigger.Trigger, error)

New implements trigger.Factory.New

type HandlerSettings

type HandlerSettings struct {
	Topic      string `md:"topic,required"` // The topic to listen on
	ReplyTopic string `md:"replyTopic"`     // The topic to reply on
	Qos        int    `md:"qos"`            // The Quality of Service
	Retain     bool   `md:"retain"`         // Retain messages
	AssetName  string `md:"assetName"`
	SensorName string `md:"sensorName"`
	SensorType string `md:"sensorType"`
}

type Output

type Output struct {
	Message     string            `md:"message"`     // The message recieved
	Topic       string            `md:"topic"`       // The MQTT topic
	TopicParams map[string]string `md:"topicParams"` // The topic parameters
	AssetName   string            `md:"assetName"`
	SensorName  string            `md:"sensorName"`
	SensorType  string            `md:"sensorType"`
}

func (*Output) FromMap

func (o *Output) FromMap(values map[string]interface{}) error

func (*Output) ToMap

func (o *Output) ToMap() map[string]interface{}

type Reply

type Reply struct {
	Data interface{} `md:"data"` // The data to reply with
}

func (*Reply) FromMap

func (r *Reply) FromMap(values map[string]interface{}) error

func (*Reply) ToMap

func (r *Reply) ToMap() map[string]interface{}

type Settings

type Settings struct {
	Broker        string                 `md:"broker,required"` // The broker URL
	Id            string                 `md:"id,required"`     // The id of client
	Username      string                 `md:"username"`        // The user's name
	Password      string                 `md:"password"`        // The user's password
	Store         string                 `md:"store"`           // The store for message persistence
	CleanSession  bool                   `md:"cleanSession"`    // Clean session flag
	KeepAlive     int                    `md:"keepAlive"`       // Keep Alive time in seconds
	AutoReconnect bool                   `md:"autoReconnect"`   // Enable Auto-Reconnect
	SSLConfig     map[string]interface{} `md:"sslConfig"`       // SSL Configuration
}

type Token

type Token struct {
	TokenType TokenType
	Token     string
}

Token is a MQTT topic token

type TokenType

type TokenType int

TokenType is a type of token

const (
	// Literal is a literal token type
	Literal TokenType = iota
	// SingleLevel is a single level wildcard
	SingleLevel
	// MultiLevel is a multi level wildcard
	MultiLevel
)

type Topic

type Topic []Token

Topic is a parsed topic

func ParseTopic

func ParseTopic(topic string) Topic

ParseTopic parses the topic

func (Topic) Match

func (t Topic) Match(input Topic) map[string]string

Match matches the topic with an input topic

func (Topic) String

func (t Topic) String() string

String generates a string for the topic

type Trigger

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

Trigger is simple MQTT trigger

func (*Trigger) Initialize

func (t *Trigger) Initialize(ctx trigger.InitContext) error

Initialize implements trigger.Initializable.Initialize

func (*Trigger) Start

func (t *Trigger) Start() error

Start implements trigger.Trigger.Start

func (*Trigger) Stop

func (t *Trigger) Stop() error

Stop implements ext.Trigger.Stop

Jump to

Keyboard shortcuts

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