Documentation
¶
Overview ¶
Package template renders keepup parameter/command strings.
It owns the Expander abstraction the engine depends on (dependency inversion): the engine asks "expand this string against these outputs and env" without knowing the implementation. The default implementation is Go's text/template with the sprig function library, plus two keepup-specific functions:
output "name" → the captured stdout of a prior group env "KEY" → a value from the merged keepup environment
A backward-compatibility shim rewrites the legacy "{{ output.X }}" form into the function form "{{ output \"X\" }}" before parsing, so configs written against the original substring expander keep working unchanged.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Refs ¶
Refs returns the group names a template references via output("X") or out("X"), in encounter order (duplicates preserved; callers de-duplicate as needed). The following forms are all handled:
- legacy dot form: {{ output.X }}
- function form: {{ output "X" }} / {{ out "X" }}
- dot-access form: {{ (out "X").ExitCode }} / {{ (out "X").Status }}
Only string-literal arguments are extractable; a dynamically-computed name (e.g. output (printf "g%d" 1)) cannot be resolved statically and is ignored.