Documentation ¶
Index ¶
- type Flags
- func (f *Flags) AddFlags(flags *pflag.FlagSet)
- func (f *Flags) AllowedFormats() []string
- func (f *Flags) Copy() Flags
- func (f *Flags) EnsureWithGroup()
- func (f *Flags) IsTableOutputFormat(outputFormat string) bool
- func (f *Flags) SetShowNamespace(b bool)
- func (f *Flags) ToPrinter(client client.Interface) (Interface, error)
- type HumanPrintFlags
- func (f *HumanPrintFlags) AddFlags(flags *pflag.FlagSet)
- func (f *HumanPrintFlags) AllowedFormats() []string
- func (f *HumanPrintFlags) EnsureWithGroup()
- func (f *HumanPrintFlags) IsSplitOutputFormat(outputFormat string) bool
- func (f *HumanPrintFlags) IsSupportedOutputFormat(outputFormat string) bool
- func (f *HumanPrintFlags) IsWideOutputFormat(outputFormat string) bool
- func (f *HumanPrintFlags) SetShowNamespace(b bool)
- func (f *HumanPrintFlags) ToPrinter(outputFormat string) (printers.ResourcePrinter, error)
- func (f *HumanPrintFlags) ToPrinterWithGK(outputFormat string, gk schema.GroupKind) (printers.ResourcePrinter, error)
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Flags ¶ added in v0.3.0
type Flags struct { HumanReadableFlags *HumanPrintFlags OutputFormat *string }
Flags composes common printer flag structs used in the command.
func NewFlags ¶
func NewFlags() *Flags
NewFlags returns flags associated with human-readable printing, with default values set.
func (*Flags) AddFlags ¶ added in v0.3.0
AddFlags receives a *pflag.FlagSet reference and binds flags related to human-readable printing to it.
func (*Flags) AllowedFormats ¶ added in v0.3.0
AllowedFormats is the list of formats in which data can be displayed.
func (*Flags) EnsureWithGroup ¶ added in v0.3.0
func (f *Flags) EnsureWithGroup()
EnsureWithGroup ensures that human-readable flags return a printer capable of including resource group.
func (*Flags) IsTableOutputFormat ¶ added in v0.3.0
IsTableOutputFormat returns true if provided output format is a table format.
func (*Flags) SetShowNamespace ¶ added in v0.3.0
SetShowNamespace configures whether human-readable flags return a printer capable of printing with a "namespace" column.
type HumanPrintFlags ¶
type HumanPrintFlags struct { ColumnLabels *[]string NoHeaders *bool ShowGroup *bool ShowLabels *bool ShowNamespace *bool }
HumanPrintFlags provides default flags necessary for printing. Given the following flag values, a printer can be requested that knows how to handle printing based on these values.
func NewHumanPrintFlags ¶
func NewHumanPrintFlags() *HumanPrintFlags
NewHumanPrintFlags returns flags associated with human-readable printing, with default values set.
func (*HumanPrintFlags) AddFlags ¶
func (f *HumanPrintFlags) AddFlags(flags *pflag.FlagSet)
AddFlags receives a *pflag.FlagSet reference and binds flags related to human-readable printing to it.
func (*HumanPrintFlags) AllowedFormats ¶
func (f *HumanPrintFlags) AllowedFormats() []string
AllowedFormats returns more customized formating options.
func (*HumanPrintFlags) EnsureWithGroup ¶
func (f *HumanPrintFlags) EnsureWithGroup()
EnsureWithGroup sets the "ShowGroup" human-readable option to true.
func (*HumanPrintFlags) IsSplitOutputFormat ¶ added in v0.3.0
func (f *HumanPrintFlags) IsSplitOutputFormat(outputFormat string) bool
IsSplitOutputFormat returns true if provided output format is a split table format.
func (*HumanPrintFlags) IsSupportedOutputFormat ¶ added in v0.3.0
func (f *HumanPrintFlags) IsSupportedOutputFormat(outputFormat string) bool
IsSupportedOutputFormat returns true if provided output format is supported.
func (*HumanPrintFlags) IsWideOutputFormat ¶ added in v0.3.0
func (f *HumanPrintFlags) IsWideOutputFormat(outputFormat string) bool
IsWideOutputFormat returns true if provided output format is a wide table format.
func (*HumanPrintFlags) SetShowNamespace ¶ added in v0.3.0
func (f *HumanPrintFlags) SetShowNamespace(b bool)
SetShowNamespace sets the "ShowNamespace" human-readable option.
func (*HumanPrintFlags) ToPrinter ¶
func (f *HumanPrintFlags) ToPrinter(outputFormat string) (printers.ResourcePrinter, error)
ToPrinter receives an outputFormat and returns a printer capable of handling human-readable output.
func (*HumanPrintFlags) ToPrinterWithGK ¶ added in v0.3.0
func (f *HumanPrintFlags) ToPrinterWithGK(outputFormat string, gk schema.GroupKind) (printers.ResourcePrinter, error)
ToPrinter receives an outputFormat and returns a printer capable of handling human-readable output.