{"modulePath":"github.com/dracory/nodebase","version":"v0.7.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package split\n\nPackage split contains the split node implementation.\n\n## Types\n\n```go\ntype SplitConfig struct {\n\t// Property is the message field to split; \"payload\" (default) targets\n\t// msg.Payload, otherwise a dotted path inside the data map\n\tProperty string `json:\"property\"`\n\t// Splt is the split delimiter (strings/buffers) or the fixed record\n\t// length when SpltType is \"len\" (parseInt semantics apply)\n\tSplt string `json:\"splt\"`\n\t// SpltType selects the split mode: \"str\" (default) | \"bin\" | \"len\"\n\tSpltType string `json:\"spltType\"`\n\t// ArraySplt is the chunk length for array payloads (default 1)\n\tArraySplt int `json:\"arraySplt\"`\n\t// Addname optionally copies each part's key (objects) or index to a\n\t// field on every emitted message\n\tAddname string `json:\"addname\"`\n}\n```\nSplitConfig 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.\n\n```go\ntype SplitNode struct {\n\t*nodebase.BaseNode\n\t// contains filtered or unexported fields\n}\n```\nSplitNode 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.\n\n```go\nfunc NewSplitNode(node nodestore.NodeInterface, config *SplitConfig) *SplitNode\n```\nNewSplitNode creates a new split node\n\n```go\nfunc (n *SplitNode) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)\n```\nExecute passes the input through unchanged — expansion is done by the host via Expand\n\n```go\nfunc (n *SplitNode) Expand(output nodestore.MessageInterface) []nodestore.MessageInterface\n```\nExpand 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.\n\n","path":"github.com/dracory/nodebase/split","name":"split","synopsis":"Package split contains the split node implementation.","isRedistributable":true}
