mqttcoupler

package module
v0.0.0-...-89bbdfb Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0, BSD-3-Clause, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

Types

type Activity

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

func (*Activity) Eval

func (a *Activity) Eval(ctx activity.Context) (done bool, err error)

func (*Activity) Metadata

func (a *Activity) Metadata() *activity.Metadata

func (*Activity) WaitMessage

func (a *Activity) WaitMessage(logger log.Logger, topic string) mqtt.Message

type Input

type Input struct {
	Message     interface{}       `md:"message"`     // The message to send
	TopicParams map[string]string `md:"topicParams"` // The topic parameters
}

func (*Input) FromMap

func (i *Input) FromMap(values map[string]interface{}) error

func (*Input) ToMap

func (i *Input) ToMap() map[string]interface{}

type Output

type Output struct {
	Data interface{} `md:"data"` // The data recieved
}

func (*Output) FromMap

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

func (*Output) ToMap

func (o *Output) 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
	KeepAlive       int64  `md:"keepAlive"`       // Keep Alive
	CleanSession    bool   `md:"cleanSession"`    // Clean session flag
	ResponseTimeout int    `md:"responseTimeout"` // response timeout (sec)

	Retain    bool                   `md:"retain"`         // Retain Messages
	Topic     string                 `md:"topic,required"` // The topic to publish to
	Qos       int                    `md:"qos"`            // The Quality of Service
	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
	// Substitution is a parameter substitution
	Substitution
)

type Topic

type Topic []Token

Topic is a parsed topic

func ParseTopic

func ParseTopic(topic string) Topic

ParseTopic parses the topic

func (Topic) String

func (t Topic) String(params map[string]string) string

String generates a string for the topic with params

type TopicMessages

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

func NewTopicMessages

func NewTopicMessages() *TopicMessages

Jump to

Keyboard shortcuts

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