Documentation ¶
Index ¶
- func AddAllNamespace(flagSet *pflag.FlagSet)
- func AddChunkSizeFlag(flagSet *pflag.FlagSet)
- func AddFieldSelectorFlag(flagSet *pflag.FlagSet)
- func AddFormatFlag(flagSet *pflag.FlagSet)
- func AddInteractiveFlag(flagSet *pflag.FlagSet)
- func AddLabelSelectorFlag(flagSet *pflag.FlagSet)
- func ConfirmDelete(name string) bool
- func ConfirmOptOut() bool
- func DetectEmptyStdin(f *os.File) error
- func FlagHasChanged(name string, flagset *pflag.FlagSet) bool
- func GetChangedStringValueFlag(name string, flagset *pflag.FlagSet) string
- func GetCurrentUsername(cfg config.Config) string
- func InputData(filename string) (io.Reader, error)
- func JoinErrors(prelude string, errs []error) error
- func ListOptionsFromFlags(flagSet *pflag.FlagSet) (client.ListOptions, error)
- func Print(cmd *cobra.Command, format string, printTable printTableFunc, ...) error
- func PrintFormatted(flag string, format string, v interface{}, w io.Writer, ...) error
- func PrintJSON(r interface{}, io io.Writer) error
- func PrintTitle(flag string, format string, title string, w io.Writer) error
- func PrintWrappedJSON(r types.Resource, wr io.Writer) error
- func PrintWrappedJSONList(r []types.Resource, io io.Writer) error
- func PrintYAML(v interface{}, w io.Writer) (err error)
- func SafeSplitCSV(i string) []string
- func VerifyName(args []string) error
- type Confirm
- type ConfirmDestructiveOp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAllNamespace ¶
AddAllNamespace adds the '--all-namespaces' flag to the given command
func AddChunkSizeFlag ¶
AddChunkSizeFlag adds the '--chunk-size' flag to the given command
func AddFieldSelectorFlag ¶
AddFieldSelectorFlag adds the '--field-selector' flag to the given command
func AddFormatFlag ¶
AddFormatFlag adds the format flag to the given command. When given client configuration the user's configured default format is used as the flag's default value.
func AddInteractiveFlag ¶
AddInteractiveFlag adds the '--interactive' flag to the given command
func AddLabelSelectorFlag ¶
AddLabelSelectorFlag adds the '--label-selector' flag to the given command
func ConfirmDelete ¶
ConfirmDelete confirm a deletion operation before it is completed.
func ConfirmOptOut ¶
func ConfirmOptOut() bool
ConfirmOptOut confirm an opt-out operation before it is completed.
func DetectEmptyStdin ¶
DetectEmptyStdin determines if stdin is empty
func FlagHasChanged ¶
FlagHasChanged determines if the user has set the value of a flag, or left it to default
func GetChangedStringValueFlag ¶
GetChangedStringValueFlag returns the value of a flag that has been explicitely changed by the user, and not left to default
func GetCurrentUsername ¶
GetCurrentUsername retrieves the username from the active JWT
func InputData ¶
InputData returns the content of filename, if provided, or the standard input. An error is returned if no input data is provided or if the file could not be open
func JoinErrors ¶
JoinErrors joins multiple errors messages. Useful when you want the CLI to display more than one error message.
eg.
JoinErrors("Validation: ", []error{errors.New("a"), errors.New("b")}) "Validation: a, and b."
func ListOptionsFromFlags ¶
func ListOptionsFromFlags(flagSet *pflag.FlagSet) (client.ListOptions, error)
ListOptionsFromFlags construct an appropriate ListOptions given a FlagSet.
func Print ¶
func Print(cmd *cobra.Command, format string, printTable printTableFunc, objects []types.Resource, v interface{}) error
Print displays
func PrintFormatted ¶
func PrintFormatted(flag string, format string, v interface{}, w io.Writer, printToList func(interface{}, io.Writer) error) error
PrintFormatted prints the provided interface in the specified format. flag overrides the cli config format if set
func PrintJSON ¶
PrintJSON takes a record(s) and an io.Writer, converts the record to human- readable JSON (pretty-prints), and then prints the result to the given writer. Unescapes any &, <, or > characters it finds.
func PrintTitle ¶
PrintTitle prints a title for tabular format only. Flag overrides the cli config format, if set.
func PrintWrappedJSON ¶
PrintWrappedJSON takes a record(s) and Resource, converts the record to human-readable JSON (pretty-prints), wraps that JSON using types.Wrapper, and then prints the result to the given writer. Unescapes any &, <, or > characters it finds.
func PrintWrappedJSONList ¶
PrintWrappedJSONList takes a resource list and an io.Writer, converts the record to human-readable JSON (pretty-prints), wraps that JSON using types.Wrapper, and then prints the result to the given writer. Unescapes any &, <, or > characters it finds.
func SafeSplitCSV ¶
SafeSplitCSV splits given string and trims and extraneous whitespace
func VerifyName ¶
VerifyName ensures that (only) a name was provided in the arguments
Types ¶
type ConfirmDestructiveOp ¶
ConfirmDestructiveOp presents prompt for a destructive operation.