Documentation
¶
Index ¶
- Variables
- type DiscoverArgs
- type FieldConfig
- type FieldWithType
- type FreepsMqttConfig
- type FreepsMqttImpl
- type HookMQTT
- type JsonArgs
- type OpMQTT
- func (o *OpMQTT) DiscoverTopics(ctx *base.Context, input *base.OperatorIO, args DiscoverArgs) *base.OperatorIO
- func (o *OpMQTT) ExecuteDynamic(ctx *base.Context, fn string, fa base.FunctionArguments, ...) *base.OperatorIO
- func (o *OpMQTT) GetDefaultConfig() interface{}
- func (o *OpMQTT) GetDynamicArgSuggestions(fn string, arg string, otherArgs base.FunctionArguments) map[string]string
- func (o *OpMQTT) GetDynamicFunctions() []string
- func (o *OpMQTT) GetDynamicPossibleArgs(fn string) []string
- func (o *OpMQTT) GetHook() interface{}
- func (o *OpMQTT) GetSubscriptions(ctx *base.Context) *base.OperatorIO
- func (o *OpMQTT) GraphIDSuggestions() map[string]string
- func (o *OpMQTT) InitCopyOfOperator(ctx *base.Context, config interface{}, name string) (base.FreepsOperatorWithConfig, error)
- func (o *OpMQTT) SetTopicTrigger(ctx *base.Context, mainInput *base.OperatorIO, args TopicTrigger) *base.OperatorIO
- func (o *OpMQTT) Shutdown(ctx *base.Context)
- func (o *OpMQTT) StartListening(ctx *base.Context)
- func (o *OpMQTT) TriggerSubscriptionChange(ctx *base.Context) *base.OperatorIO
- type TopicConfig
- type TopicTrigger
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTopicConfig = TopicConfig{Topic: "#", Qos: 0, MeasurementIndex: -1, FieldIndex: -1, Fields: map[string]FieldConfig{}, TemplateToCall: "mqttaction"}
Functions ¶
This section is empty.
Types ¶
type DiscoverArgs ¶ added in v1.4.0
type FieldConfig ¶
type FieldWithType ¶
type FreepsMqttConfig ¶
type FreepsMqttConfig struct { Enabled bool Server string // The full url of the MQTT server to connect to ex: tcp://127.0.0.1:1883 Username string // A username to authenticate to the MQTT server Password string // Password to match username Topics []TopicConfig ResultTopic string // Topic to publish results to; empty (default) means no publishing of results }
type FreepsMqttImpl ¶
type FreepsMqttImpl struct { Config *FreepsMqttConfig // contains filtered or unexported fields }
func (*FreepsMqttImpl) Shutdown ¶
func (fm *FreepsMqttImpl) Shutdown()
Shutdown MQTT and cancel all subscriptions
func (*FreepsMqttImpl) StartListening ¶ added in v1.3.0
func (fm *FreepsMqttImpl) StartListening() error
type JsonArgs ¶
type JsonArgs struct { Measurement string FieldsWithType map[string]FieldWithType }
type OpMQTT ¶
type OpMQTT struct { CR *utils.ConfigReader GE *freepsgraph.GraphEngine // contains filtered or unexported fields }
func (*OpMQTT) DiscoverTopics ¶ added in v1.4.0
func (o *OpMQTT) DiscoverTopics(ctx *base.Context, input *base.OperatorIO, args DiscoverArgs) *base.OperatorIO
func (*OpMQTT) ExecuteDynamic ¶ added in v1.3.0
func (o *OpMQTT) ExecuteDynamic(ctx *base.Context, fn string, fa base.FunctionArguments, input *base.OperatorIO) *base.OperatorIO
func (*OpMQTT) GetDefaultConfig ¶ added in v1.3.0
func (o *OpMQTT) GetDefaultConfig() interface{}
func (*OpMQTT) GetDynamicArgSuggestions ¶ added in v1.3.0
func (*OpMQTT) GetDynamicFunctions ¶ added in v1.3.0
func (*OpMQTT) GetDynamicPossibleArgs ¶ added in v1.3.0
func (*OpMQTT) GetSubscriptions ¶ added in v1.3.0
func (o *OpMQTT) GetSubscriptions(ctx *base.Context) *base.OperatorIO
GetSubscriptions returns a list of all subscriped topics
func (*OpMQTT) GraphIDSuggestions ¶ added in v1.4.0
GraphID auggestions returns suggestions for graph names
func (*OpMQTT) InitCopyOfOperator ¶ added in v1.3.0
func (*OpMQTT) SetTopicTrigger ¶ added in v1.4.0
func (o *OpMQTT) SetTopicTrigger(ctx *base.Context, mainInput *base.OperatorIO, args TopicTrigger) *base.OperatorIO
func (*OpMQTT) StartListening ¶ added in v1.3.0
func (*OpMQTT) TriggerSubscriptionChange ¶ added in v1.3.0
func (o *OpMQTT) TriggerSubscriptionChange(ctx *base.Context) *base.OperatorIO
TriggerSubscriptionChange triggers a change in the subscriptions
type TopicConfig ¶
type TopicConfig struct { Topic string // Topic to subscribe to Qos int // The QoS to subscribe to messages at // the topic string is split by slash; the values of the resulting array can be used as measurement and field - the index can be specified here MeasurementIndex int // index that points to the measurement in the topic-array FieldIndex int // index that points to the field in the topic-array Fields map[string]FieldConfig `json:",omitempty"` TemplateToCall string `json:",omitempty"` GraphToCall string }
type TopicTrigger ¶ added in v1.4.0
func (*TopicTrigger) TopicSuggestions ¶ added in v1.4.0
func (tt *TopicTrigger) TopicSuggestions(o *OpMQTT) []string
TopicSuggestions returns known topics
Click to show internal directories.
Click to hide internal directories.