Documentation
¶
Overview ¶
Package helmaction finds the {{ ... }} actions of a Helm template source: where each one starts and ends, quoted strings and comments included, so the resolver rewrites templates and the runner blanks them with the same rules.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Blank ¶
Blank replaces every action of source with the newlines it spanned, an unterminated one included, so the line numbers of what remains are unchanged.
Types ¶
type Action ¶
type Action struct {
Start, End int
// Comment is a {{/* ... */}} action.
Comment bool
// Unterminated actions have no closing "}}" outside quotes. They end after
// the next "}}", or at the end of the source when there is none.
Unterminated bool
}
Action is one {{ ... }} template action of a template source, as byte offsets.
func Scan ¶
Scan returns every action of s in order of start. Quoted strings (", ' and `) are opaque, so a "}}" inside one does not end an action. A comment ends at its "*/" followed by "}}", as its text may hold quotes of its own. Scanning resumes just after the "{{" of an unterminated action, so the actions after it are still found, and may lie within it.
func Terminated ¶
Terminated returns the actions of s that have a closing "}}".