Documentation ¶
Index ¶
- Variables
- func CancelOnSignal(ctx context.Context, signal_ os.Signal, cancel func()) error
- func InterfaceListToStringList(list []interface{}) []string
- func InterfaceToStringList(list interface{}) []string
- func LoadJSONFile(path string, target interface{}) error
- func LoadYAMLFile(path string, target interface{}) error
- func RenderTemplateString(tmpl string, data interface{}) (string, error)
- func StringInSlice(needle string, haystack []string) bool
- func StructToMap(i interface{}, lowerCaseKeys bool) map[string]interface{}
Constants ¶
This section is empty.
Variables ¶
View Source
var TemplateFuncs = template.FuncMap{ "trim": strings.TrimSpace, "trimRightSpace": trimRightSpace, "trimTrailingWhitespaces": trimRightSpace, "rpad": rpad, "quote": quote, "stripNewlines": stripNewlines, "quoteNewlines": quoteNewlines, "toUpper": strings.ToUpper, "toLower": strings.ToLower, "replace": replace, "replaceRegexp": replaceRegexp, "add": add, "sub": sub, "div": div, "mul": mul, "parseFloat": parseFloat, "parseInt": parseInt, "currency": currency, "padLeft": padLeft, "padRight": padRight, "bold": bold, "underline": underline, "italic": italic, "strikethrough": strikethrough, "code": code, "codeBlock": codeBlock, }
TemplateFuncs provides helpers for the standard cobra usage and help templates
Functions ¶
func CancelOnSignal ¶
func InterfaceListToStringList ¶
func InterfaceListToStringList(list []interface{}) []string
func InterfaceToStringList ¶
func InterfaceToStringList(list interface{}) []string
func LoadJSONFile ¶
func LoadYAMLFile ¶
func RenderTemplateString ¶
func StringInSlice ¶
func StructToMap ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.