Documentation ¶
Index ¶
- Variables
- func IterativelyTemplate(vars map[string]interface{}) (map[string]interface{}, error)
- func RenderTemplate(inputTemplate string, vars map[string]interface{}) (string, error)
- func TemplateFile(src string, outBuf *bytes.Buffer, vars map[string]interface{}) error
- func TemplateString(src string, outBuf *bytes.Buffer, vars map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var CustomFunctions = template.FuncMap{
"exists": exists,
"findFiles": findFiles,
"mapPrintF": mapPrintF,
"listString": listString,
"isSet": isSet,
"removeEmpty": removeEmpty,
}
Functions ¶
func IterativelyTemplate ¶
Iterate over the input variables trying to replace data as if it was a template. Keep iterating up to a maximum number of times, or until the size of the input and output remain the same. Doing this allows us to define intermediate variables or aliases (e.g. set `cluster_name` = '{{ .stack.region }}-{{ .stack.account }}' then just use '{{ .kapp.vars.cluster_name }}'. Templating this requires 2 iterations).
func RenderTemplate ¶
Returns a template rendered with the given input variables
func TemplateFile ¶
Renders a template from a template file to a buffer
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.