nodes

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: Apache-2.0 Imports: 42 Imported by: 0 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 nodes contains the built-in node types.

Index

Constants

This section is empty.

Variables

View Source
var Commands = &shell.Policy{}

Commands is the process-wide policy the exec node is checked against. main installs it from the configuration before any flow starts, exactly as it does the discovery Scope, so a node can never run against an unset policy — the zero value refuses everything.

View Source
var Files = &filescope.Scope{}

Files is the process-wide path scope. main installs it from the configuration before any flow starts; the zero value refuses everything, so a node can never run against an unset scope.

View Source
var Links = &LinkRegistry{
	inputs:  map[string]*linkInNode{},
	pending: map[string][]*linkOutNode{},
}

Links is the process-wide link registry.

View Source
var Routes = flowhttp.NewRouter("/", nil)

Routes is the process-wide flow route table. main installs it before any flow starts; the zero value has no routes and refuses to register any, so a node can never bind against a router nobody is serving.

Scope is the process-wide discovery scope, installed at startup from the configuration. Nil until then, which reads as disabled.

View Source
var TCPReplies = &tcpReplyRegistry{}

TCPReplies is the process-wide reply registry.

Functions

func DeleteTypedTarget

func DeleteTypedTarget(ec EvalContext, targetType, target string) error

DeleteTypedTarget removes a message property or context key.

func SetTypedTarget

func SetTypedTarget(ec EvalContext, targetType, target string, value any) error

SetTypedTarget writes a value to a destination described by a type and a property path: a message property, or a flow- or global-context key.

Types

type EvalContext

type EvalContext struct {
	Msg      *engine.Msg
	Services node.Services
	// Now is the clock, injectable so date-typed values are testable.
	Now func() time.Time
}

EvalContext is what a typed value needs in order to resolve.

type InfluxTarget

type InfluxTarget interface {
	Write(ctx context.Context, body []byte) error
}

InfluxTarget is how an action node reaches its config node.

type LinkRegistry

type LinkRegistry struct {
	// contains filtered or unexported fields
}

LinkRegistry resolves link targets across the whole runtime. Link wires cross tab boundaries, so they cannot be resolved from the flow graph alone.

func (*LinkRegistry) Reset

func (lr *LinkRegistry) Reset()

Reset clears the registry. Called on redeploy, and by tests.

type MQTTBroker

type MQTTBroker interface {
	Client() mqtt.Client
	Subscribe(topic string, qos byte, h mqtt.MessageHandler) error
	Unsubscribe(topic string) error
}

MQTTBroker is how in and out nodes reach their shared connection.

type PoolProvider

type PoolProvider interface {
	Pool(ctx context.Context) (*pgxpool.Pool, error)
}

PoolProvider is how an action node reaches its config node's connection pool. Config nodes are handed back through Services.ConfigNode as a node.Node, so the capability is discovered by type assertion.

type TypedValue

type TypedValue struct {
	Type  string
	Value string
}

TypedValue is a value paired with the type discriminator that says how to interpret it.

This is Node-RED's typedInput, and it is the mechanism that makes flows composable: a field can hold a literal, a property of the incoming message, a context lookup, or an environment variable, and the node does not care which. The discriminator is stored in a companion property whose name varies by node — "pt" and "tot" on a Change rule, "vt" on a Switch rule — so it is always read explicitly rather than guessed.

func ReadTypedValue

func ReadTypedValue(raw map[string]any, valueKey, typeKey, defType string) TypedValue

ReadTypedValue pulls a typed value out of a raw config map, given the key holding the value and the key holding its type.

defType is used when the type key is absent, which happens for flows written against older Node-RED versions where some fields were untyped strings.

func (TypedValue) Eval

func (tv TypedValue) Eval(ec EvalContext) (any, bool, error)

Eval resolves a typed value.

Returning (nil, false, nil) means the reference was valid but resolved to nothing — a message property that is absent, a context key that was never set. Callers distinguish that from an error, because "not present" is a normal control-flow signal in a flow and an error is not.

Jump to

Keyboard shortcuts

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