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 the Key property
Mode string `json:"mode"`
// Property is the message field joined; "payload" (default) targets
// msg.GetPayload(), otherwise a dotted path inside the data map
Property string `json:"property"`
// Key is the dotted path into Data whose value groups messages in
// custom mode (e.g. "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"`
// 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"`
}
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 key. Until the group is complete the message is dropped (nil return); on completion a single joined message is returned and flows downstream.