split

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

Documentation

Overview

Package split contains the split node implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SplitConfig

type SplitConfig struct {
	// Property is the message field to split; "payload" (default) targets
	// msg.Payload, otherwise a dotted path inside the data map
	Property string `json:"property"`
	// Splt is the split delimiter (strings/buffers) or the fixed record
	// length when SpltType is "len" (parseInt semantics apply)
	Splt string `json:"splt"`
	// SpltType selects the split mode: "str" (default) | "bin" | "len"
	SpltType string `json:"spltType"`
	// ArraySplt is the chunk length for array payloads (default 1)
	ArraySplt int `json:"arraySplt"`
	// Addname optionally copies each part's key (objects) or index to a
	// field on every emitted message
	Addname string `json:"addname"`
}

SplitConfig holds configuration for the split node — the Node-RED split equivalent. Splits a string, array, object or buffer into a sequence of messages tagged with `parts` metadata so a downstream join node can reassemble them.

type SplitNode

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

SplitNode expands one message into a sequence. Execute is a pass-through; the actual fan-out happens in Expand, driven by the host's MessageExpander hook.

func NewSplitNode

func NewSplitNode(node nodestore.NodeInterface, config *SplitConfig) *SplitNode

NewSplitNode creates a new split node

func (*SplitNode) Execute

Execute passes the input through unchanged — expansion is done by the host via Expand

func (*SplitNode) Expand

Expand splits the configured property into a sequence of payloads, each carrying `parts` metadata (id, type, index, count, plus ch for strings, key for objects, property when not "payload"). A previous `parts` block is preserved under parts.parts (nested splits). Non-splittable data yields the original message unchanged.

Jump to

Keyboard shortcuts

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