Documentation
¶
Index ¶
- func Exec(command string, args []interface{}, inputs ...string) (string, error)
- func Get(path string, varArgs ...interface{}) (interface{}, error)
- func HasKey(path string, varArgs ...interface{}) (bool, error)
- func ReadFile(file string) (string, error)
- func Required(warn string, val interface{}) (interface{}, error)
- func RequiredEnv(name string) (string, error)
- func ToYaml(v interface{}) (string, error)
- func Tpl2yml(tpl, yml string, data interface{}, templaterName string) error
- type Templater
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exec ¶
Exec runs external binary and returns its standard output. Used as custom template function.
func Get ¶
Get returns value in map by dot-separated key path. First argument is dot-separated key path. Second argument is default value if key not found and is optional. Third argument is map to search in. Used as custom template function.
func HasKey ¶
HasKey searches for any value by dot-separated key path in map. Used as custom template function.
func ReadFile ¶
ReadFile reads file and returns its contents as string. Used as custom template function.
func Required ¶
Required returns error if val is nil of empty string. Otherwise it returns the same val. Used as custom template function.
func RequiredEnv ¶
RequiredEnv returns environment variable by name and errors if it is not defined. Used as custom template function.
Types ¶
type Templater ¶ added in v0.17.0
Templater is interface for using different template function groups.