Documentation
¶
Overview ¶
Package mqttout contains the mqttOut node implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MQTTOutConfig ¶
type MQTTOutConfig struct {
// Broker is host:port or a full URL (tcp://host:port).
Broker string `json:"broker"`
// Topic is the publish topic (the message's topic metadata overrides it).
Topic string `json:"topic"`
// QoS is the publish quality of service (0|1|2).
QoS int `json:"qos"`
// Retain sets the MQTT retain flag on published messages.
Retain bool `json:"retain"`
// Username/Password are optional broker credentials. They are
// credential-typed fields: stored outside the exported flow
// document and merged back in at deploy time.
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
MQTTOutConfig holds configuration for the mqttOut node.
type MQTTOutNode ¶
MQTTOutNode publishes the message Data to a broker topic and passes the input through unchanged. Connections are shared per workflow via the host-state MQTTClientPool.
func NewMQTTOutNode ¶
func NewMQTTOutNode(node nodestore.NodeInterface, config *MQTTOutConfig, host nodebase.NodeHost) *MQTTOutNode
NewMQTTOutNode creates a new mqttOut node
func (*MQTTOutNode) Execute ¶
func (n *MQTTOutNode) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute serializes Data, publishes it and returns the input payload.
func (*MQTTOutNode) Validate ¶
func (n *MQTTOutNode) Validate() error
Validate checks the mqttOut node configuration