mqttin

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 12 Imported by: ? modules, 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.

Documentation

Overview

Package mqttin contains the mqttIn node implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MQTTInConfig

type MQTTInConfig struct {
	// Broker is host:port or a full URL (tcp://host:port).
	Broker string `json:"broker"`
	// Topic is the subscription topic; MQTT wildcards + and # work.
	Topic string `json:"topic"`
	// QoS is the subscription quality of service (0|1|2).
	QoS int `json:"qos"`
	// Datatype selects payload decoding: "auto" (JSON parse, else
	// string), "utf8" (string), "json" (parse or error), "base64".
	Datatype string `json:"datatype"`
	// ShareGroup, when set, turns the subscription into an MQTT shared
	// subscription: the filter becomes $share/<group>/<topic> and the
	// broker load-balances deliveries across all subscribers in the
	// group (active-active triggers for multi-runner deployments).
	// A raw $share/<group>/<topic> value in Topic also works and is
	// passed through unchanged.
	ShareGroup string `json:"shareGroup"`
	// 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"`
}

MQTTInConfig holds configuration for the mqttIn node. Broker settings are inline per node — the Node-RED shared broker config-node concept is deferred (see docs/ai/tasks 30-mqtt-nodes).

type MQTTInNode

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

MQTTInNode subscribes to an MQTT broker topic on deploy and emits every received message downstream. It is a Stopper: the client lives on the node instance itself (activation runs Execute once and the same instance is kept for Stop).

func NewMQTTInNode

func NewMQTTInNode(node nodestore.NodeInterface, config *MQTTInConfig, host nodebase.NodeHost) *MQTTInNode

NewMQTTInNode creates a new mqttIn node

func (*MQTTInNode) Execute

Execute connects to the broker and subscribes. The connect happens synchronously so an unreachable broker surfaces as a deploy error.

func (*MQTTInNode) Stop

func (n *MQTTInNode) Stop() error

Stop disconnects the broker client.

func (*MQTTInNode) Validate

func (n *MQTTInNode) Validate() error

Validate checks the mqttIn node configuration

Jump to

Keyboard shortcuts

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