Documentation
¶
Overview ¶
Package tmpl resolves {{ref}} / {{{ref}}} template tokens in a raw node definition against the node's input view (flow inputs + upstream outputs) and optional dynamic-variable generators, before the node is decoded. Refs use the same path addressing as assertions (value.Value.Get), so templates and assertions are symmetric. Nodes never see templates — they receive fully resolved, typed config.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Resolve ¶
func Resolve(raw json.RawMessage, view value.Value, dyn DynFunc) (json.RawMessage, error)
Resolve substitutes template tokens in raw using the input view and dynamic-var resolver, returning resolved JSON. Unresolved refs are left verbatim so a typo is visible rather than silently empty.
It rewrites the raw bytes directly: templates can only occur inside JSON string values, so everything outside string literals (and every string with no token) is copied verbatim, skipping the unmarshal-to-any/walk/remarshal round trip that dominated templated-node cost. Object keys are never templated (matching the previous walk, which only visited values).