Documentation ¶
Index ¶
- func ApplyOptions(cmd *cobra.Command, funcs []OptionsFunc)
- func Contains(a []string, s string) bool
- func ContainsSubstring(a []string, substring string) bool
- func MustReplaceCmd(parent *cobra.Command, new *cobra.Command)
- func Print(output, template string, m proto.Message, tblPrn Printer, w io.Writer) error
- func PrintJSON(m proto.Message, w io.Writer) error
- func PrintJSONList(data interface{}, w io.Writer) error
- func PrintList(output, template string, list interface{}, tblPrn Printer, w io.Writer) error
- func PrintTemplate(data interface{}, tmpl string, w io.Writer) error
- func PrintYAML(m proto.Message, w io.Writer) error
- func PrintYAMLList(data interface{}, w io.Writer) error
- func RandKubeNameBytes(n int) string
- func RandStringBytes(n int, basis string) string
- func ReplaceCmd(parent *cobra.Command, new *cobra.Command) error
- type CmdFunc
- type Options
- type OptionsFunc
- type Printer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyOptions ¶
func ApplyOptions(cmd *cobra.Command, funcs []OptionsFunc)
func ContainsSubstring ¶
Contains indicates if a string slice 'a' contains a string that encompases the string s
func PrintJSONList ¶
PrintJSONList - prints the given list to io.Writer in JSON
func PrintList ¶
PrintList - prints the given list of values to io.Writer using the specified output format
func PrintTemplate ¶
PrintTemplate prints the give value using the provided Go template to io.Writer
func PrintYAMLList ¶
PrintYAMLList - prints the given list to io.Writer in YAML
func RandKubeNameBytes ¶
RandDNS1035 generates a random string of length n that meets the DNS-1035 standard used by Kubernetes names
Typical kubernetes error message for invalid names: a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')
func RandStringBytes ¶
RandStringBytes produces a random string of length n using the characters present in the basis string