Documentation
¶
Index ¶
- func EnsurePrefix(data map[string]interface{}) map[string]interface{}
- func Exists(path string, data map[string]interface{}) bool
- func RenderMap(obj any, data map[string]any) error
- func RenderStruct(obj any, data map[string]any) error
- func RenderTextStringMap(m map[string]string, data map[string]interface{}) error
- func RenderTextV2(inputVal string, data map[string]interface{}) (string, error)
- func RenderV2(inputVal string, data map[string]interface{}) (string, error)
- func RenderVar(v Var, data map[string]interface{}) (string, error)
- func RenderWithWarnings(inputVal string, data map[string]interface{}) (string, []error, error)
- func ValidateTextTemplate(inputVal string) error
- type RenderErr
- type Var
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsurePrefix ¶
func RenderStruct ¶
want to write a type that can walk an object recursively and any field that has a struct
func RenderTextStringMap ¶ added in v0.19.1086
RenderTextStringMap renders every value of m in place using RenderTextV2.
func RenderTextV2 ¶ added in v0.19.1086
RenderTextV2 does the same thing as RenderV2, but using "text/template" instead of "html/template", so special characters are not escaped. Use it for values that end up in infrastructure APIs rather than in a browser: an input value containing "&" or a quote renders as "&" / """ through RenderV2, which silently corrupts things like CloudFormation parameters.
func RenderWithWarnings ¶
RenderWithWarnings walks through the template variable by variable and will return well formed errors for any partial that was "unrenderable".
func ValidateTextTemplate ¶ added in v0.19.1086
ValidateTextTemplate reports whether inputVal parses against the same function set RenderTextV2 executes with. Use it to reject a bad template early (e.g. at config sync) instead of failing later at render time.