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 {
nodebase.MQTTConnConfig
// Topic is the publish topic; when blank the message's topic metadata is used (Node-RED precedence).
Topic string `json:"topic"`
// QoS is the publish quality of service (0|1|2). A nil pointer
// marks a blank config — Node-RED serializes blank qos as "" and
// msg.qos is the fallback — so it stays distinct from explicit 0.
QoS *int `json:"qos"`
// Retain sets the MQTT retain flag on published messages. Nil
// means the config was blank ("") and msg.retain is the fallback.
Retain *bool `json:"retain"`
}
MQTTOutConfig holds configuration for the mqttOut node. The embedded MQTTConnConfig carries the connection block (broker address or an mqttBroker config-node id, credentials, clientID, clean session, keepalive, TLS and last-will fields).
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