mqttout

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

MQTT Out node

Type: mqttOut
Category: Network

Publishes the message to an MQTT broker topic.

Behavior

This node is registered as mqttOut and runs as part of a workflow. Its exact runtime behavior is implemented in node.go; this document summarizes the editor-facing purpose and configuration contract.

Configuration

Field Type Default Description
broker ``
cleansession boolean true Clean Session
clientid ``
keepalive integer 0 Keep Alive — MQTT keepalive in seconds; 0 uses the library default
password string Password — Optional broker password (credential: masked, never exported)
qos integer 0 QoS — Publish QoS; when blank the message's qos metadata is used instead
retain boolean false Retain — Retain flag; when blank the message's retain metadata is used instead
tls ``
tlsca ``
tlscert ``
tlsinsecure boolean false Skip Peer Verification — Disables broker certificate verification (insecure opt-out)
tlskey ``
tlsservername ``
topic ``
username string Username — Optional broker username (credential: masked, never exported)
usetls boolean false Use TLS — Dial the broker over TLS (implied by an ssl:// address)
willpayload ``
willqos integer 0 Will QoS
willretain boolean false Will Retain
willtopic ``

Implementation

  • node.go contains the executor, validation, schema, and registration.
  • editor.html contains the editor integration.
  • node_test.go, when present, contains behavioral tests.

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

type MQTTOutNode struct {
	*nodebase.BaseNode
	// contains filtered or unexported fields
}

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

Execute serializes Data, publishes it and returns the input payload.

func (*MQTTOutNode) Validate

func (n *MQTTOutNode) Validate() error

Validate checks the mqttOut node configuration

Jump to

Keyboard shortcuts

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