Documentation
¶
Overview ¶
Package join contains the join node implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JoinConfig ¶
type JoinConfig struct {
// Mode selects grouping: "auto" uses the message's parts metadata
// (split→join pairing); "custom" groups by count/timeout/complete;
// "reduce" folds a parts sequence with ReduceExp
Mode string `json:"mode"`
// Property is the message property joined and (for non-auto modes)
// written on the result; "payload" (default) or a message path
Property string `json:"property"`
// PropertyType is Node-RED's selector; "full" joins the whole
// message object
PropertyType string `json:"propertyType"`
// Key is the message property read for the custom "object" build
// key (default "topic")
Key string `json:"key"`
// Build selects the joined shape: "array" | "object" | "merged" | "string"
Build string `json:"build"`
// Joiner is the delimiter used by the "string" build; escape
// sequences like \n are unescaped
Joiner string `json:"joiner"`
// JoinerType is Node-RED's joiner selector ("str" unescapes; other
// values are taken literally)
JoinerType string `json:"joinerType"`
// Count is the custom-mode group size (auto mode uses parts.count)
Count int `json:"count"`
// Timeout flushes an incomplete custom-mode group after this many
// seconds (0 = wait forever)
Timeout float64 `json:"timeout"`
// Accumulate keeps a custom-mode merged/object group open after
// each emission so later messages keep merging
Accumulate bool `json:"accumulate"`
// UseParts preserves (false strips) parts metadata in custom mode;
// Node-RED defaults to true
UseParts *bool `json:"useparts"`
// ReduceExp folds each sequence message into the accumulator —
// JSONata-subset with $A (accumulator), $I (parts.index), $N (count)
ReduceExp string `json:"reduceExp"`
// ReduceInit is the accumulator's initial value
ReduceInit string `json:"reduceInit"`
// ReduceInitType interprets ReduceInit ("num"|"json"|"str"|"bool")
ReduceInitType string `json:"reduceInitType"`
// ReduceFixup optionally post-processes the accumulator ($A, $N)
ReduceFixup string `json:"reduceFixup"`
// ReduceRight folds the sequence in reverse index order
ReduceRight bool `json:"reduceRight"`
// contains filtered or unexported fields
}
JoinConfig holds configuration for the join node — the Node-RED join equivalent. Reassembles message sequences (typically produced by split) into a single message.
type JoinNode ¶
JoinNode reassembles message groups into a single joined message. It drops (returns nil) every message until its group completes.
func NewJoinNode ¶
func NewJoinNode(node nodestore.NodeInterface, config *JoinConfig, host nodebase.NodeHost) *JoinNode
NewJoinNode creates a new join node
func (*JoinNode) Execute ¶
func (n *JoinNode) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute buffers the message under its group id. Until the group is complete the message is dropped (nil return); on completion a single joined message is returned and flows downstream.