change

package
v0.4.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: 4 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.

Documentation

Overview

Package change contains the change node implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeConfig

type ChangeConfig struct {
	Rules []ChangeRule `json:"rules"`
}

ChangeConfig holds configuration for the change node

type ChangeNode

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

ChangeNode mutates msg.Payload via an ordered list of rules, the equivalent of Node-RED's change node. A failing rule is skipped so one bad rule does not abort the flow.

func NewChangeNode

func NewChangeNode(node nodestore.NodeInterface, config *ChangeConfig) *ChangeNode

NewChangeNode creates a new change node

func (*ChangeNode) Execute

Execute applies each configured rule in order and returns the mutated payload

type ChangeRule

type ChangeRule struct {
	Op    string `json:"op"` // set | delete | move
	Field string `json:"field"`
	Value string `json:"value"`
}

ChangeRule is a single ordered mutation applied to the message. Field is a dotted path; "payload" (or empty) targets msg.Payload, a "msg." prefix (e.g. "msg.statusCode") targets msg-level properties stored in Metadata — Node-RED's msg.statusCode/msg.headers equivalent — and anything else is a path inside msg.Payload.

Jump to

Keyboard shortcuts

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