Documentation ¶
Index ¶
- func GetFuncMap() template.FuncMap
- func TmplArray(path string, input interface{}) []interface{}
- func TmplFileExists(filePath string) bool
- func TmplFromYaml(str string) map[string]interface{}
- func TmplGet(path string, input interface{}) interface{}
- func TmplGetFileContent(filePath string) string
- func TmplGetFiles(directoryPath string) []os.FileInfo
- func TmplInt(path string, input interface{}) int
- func TmplIs(a interface{}, b interface{}) bool
- func TmplIsnt(a interface{}, b interface{}) bool
- func TmplRightPad(s string, padding int) string
- func TmplStrConst(value string) string
- func TmplString(path string, input interface{}) string
- func TmplToYaml(v interface{}) string
- func TmplUpperFirst(s string) string
- type KeyValuePair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TmplArray ¶
func TmplArray(path string, input interface{}) []interface{}
TmplArray parses a YAML path in the input parameter as an array. If variable found is an array, array values are returned If variable found is a map, the maps values are returned If none of above then nil is returned
func TmplFileExists ¶
func TmplFromYaml ¶
TmplFromYaml converts a YAML document into a map[string]interface{}.
This is not a general-purpose YAML parser, and will not parse all valid YAML documents. Additionally, because its intended use is within templates it tolerates errors. It will insert the returned error message string into m["Error"] in the returned map.
Borrowed from github.com/helm/helm/pkg/chartutil
func TmplGetFileContent ¶
func TmplGetFiles ¶
func TmplRightPad ¶ added in v0.9.0
TmplRightPad adds padding to the right of a string.
func TmplStrConst ¶
template function to convert from log.debug to LOG_DEBUG
func TmplToYaml ¶
func TmplToYaml(v interface{}) string
TmplToYaml takes an interface, marshals it to yaml, and returns a string. It will always return a string, even on marshal error (empty string).
This is designed to be called from a template.
Borrowed from github.com/helm/helm/pkg/chartutil
func TmplUpperFirst ¶ added in v0.9.0
TmplUpperFirst upper cases the first letter in the string
Types ¶
type KeyValuePair ¶
type KeyValuePair struct { Key string Value interface{} }
func TmplObjectArray ¶
func TmplObjectArray(path string, input interface{}) []KeyValuePair
TmplObjectArray parses a YAML path in the input parameter as an object and returns Key & Value pairs. If variable found is a map, a []KeyValuePair array is returned If variable found is a map, the maps values are returned If none of above then nil is returned