Documentation ¶
Index ¶
- Variables
- func CheckAuth(cfg config.Config) error
- func ConfiguredApplicationsCompletionFunc(f *Factory) ...
- func DisableAuthCheck(cmd *cobra.Command)
- func FlagErrorWrap(err error) error
- func FlagErrorf(format string, args ...interface{}) error
- func IndexNames(clientF func() (*search.Client, error)) ...
- func IsAuthCheckEnabled(cmd *cobra.Command) bool
- func IsNoCompatiblePrinterError(err error) bool
- func IsUserCancellation(err error) bool
- func MutuallyExclusive(message string, conditions ...bool) error
- func ReadFile(filename string, stdin io.ReadCloser) ([]byte, error)
- func ScanFile(filename string, stdin io.ReadCloser) (*bufio.Scanner, error)
- type Factory
- type FlagError
- type GoTemplatePrintFlags
- type JSONPrintFlags
- type NoCompatiblePrinterError
- type PrintFlags
Constants ¶
This section is empty.
Variables ¶
var ErrCancel = errors.New("Error: cancelled")
ErrCancel signals user-initiated cancellation
var ErrSilent = errors.New("Error: silent")
ErrSilent is an error that triggers exit code 1 without any error messaging
Functions ¶
func DisableAuthCheck ¶
func FlagErrorWrap ¶
FlagError returns a new FlagError that wraps the specified error.
func FlagErrorf ¶
FlagErrorf returns a new FlagError that wraps an error produced by fmt.Errorf(format, args...).
func IndexNames ¶
func IndexNames(clientF func() (*search.Client, error)) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
IndexNames returns a function to list the index names from the given search client.
func IsAuthCheckEnabled ¶
func IsNoCompatiblePrinterError ¶
IsNoCompatiblePrinterError returns true if it is a not a compatible printer otherwise it will return false
func IsUserCancellation ¶
func MutuallyExclusive ¶
Types ¶
type FlagError ¶
type FlagError struct { // Note: not struct{error}: only *FlagError should satisfy error. Err error }
A *FlagError indicates an error processing command-line flags or other arguments. Such errors cause the application to display the usage message.
type GoTemplatePrintFlags ¶
type GoTemplatePrintFlags struct { // indicates if it is OK to ignore missing keys for rendering // an output template. AllowMissingKeys *bool TemplateArgument *string }
func NewGoTemplatePrintFlags ¶
func NewGoTemplatePrintFlags() *GoTemplatePrintFlags
func (*GoTemplatePrintFlags) AddFlags ¶
func (f *GoTemplatePrintFlags) AddFlags(c *cobra.Command)
func (*GoTemplatePrintFlags) AllowedFormats ¶
func (f *GoTemplatePrintFlags) AllowedFormats() []string
type JSONPrintFlags ¶
type JSONPrintFlags struct{}
func NewJSONPrintFlags ¶
func NewJSONPrintFlags() *JSONPrintFlags
func (*JSONPrintFlags) AddFlags ¶
func (f *JSONPrintFlags) AddFlags(c *cobra.Command)
func (*JSONPrintFlags) AllowedFormats ¶
func (f *JSONPrintFlags) AllowedFormats() []string
type NoCompatiblePrinterError ¶
type NoCompatiblePrinterError struct { OutputFormat *string AllowedFormats []string Options interface{} }
NoCompatiblePrinterError is a struct that contains error information. It will be constructed when a invalid printing format is provided
func (NoCompatiblePrinterError) Error ¶
func (e NoCompatiblePrinterError) Error() string
type PrintFlags ¶
type PrintFlags struct { JSONPrintFlags *JSONPrintFlags TemplatePrintFlags *GoTemplatePrintFlags OutputFormat *string OutputFlagSpecified func() bool }
func (*PrintFlags) AddFlags ¶
func (f *PrintFlags) AddFlags(cmd *cobra.Command)
func (*PrintFlags) AllowedFormats ¶
func (f *PrintFlags) AllowedFormats() []string
func (*PrintFlags) WithDefaultOutput ¶
func (f *PrintFlags) WithDefaultOutput(output string) *PrintFlags
WithDefaultOutput sets a default output format if one is not provided through a flag value