Documentation
¶
Index ¶
- Variables
- func CancelOnSignal(ctx context.Context, signal_ os.Signal, cancel func()) error
- func ConvertJSONArrayToYAML(jsonContent string) (string, error)
- func ConvertJSONMapToYAML(jsonContent string) (string, error)
- func ConvertYAMLArrayToJSON(yamlContent string) (string, error)
- func ConvertYAMLMapToJSON(yamlContent string) (string, error)
- func CreateTemplate(name string) *template.Template
- 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 RenderTemplate(tmpl *template.Template, data interface{}) (string, error)
- func RenderTemplateFile(filename string, data interface{}) (string, 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, "toYaml": toYaml, "indentBlock": indentBlock, }
TemplateFuncs provides helpers for the standard cobra usage and help templates
Functions ¶
func CancelOnSignal ¶
func ConvertJSONArrayToYAML ¶ added in v0.2.5
func ConvertJSONMapToYAML ¶ added in v0.2.5
func ConvertYAMLArrayToJSON ¶ added in v0.2.5
func ConvertYAMLMapToJSON ¶ added in v0.2.5
func CreateTemplate ¶ added in v0.2.5
func InterfaceListToStringList ¶
func InterfaceListToStringList(list []interface{}) []string
func InterfaceToStringList ¶
func InterfaceToStringList(list interface{}) []string
func LoadJSONFile ¶
func LoadYAMLFile ¶
func RenderTemplate ¶ added in v0.2.5
func RenderTemplateFile ¶ added in v0.2.5
func RenderTemplateString ¶
func StringInSlice ¶
func StructToMap ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.