printers

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

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

func (f *Flags) AddFlags(flags *pflag.FlagSet)

AddFlags receives a *pflag.FlagSet reference and binds flags related to human-readable printing to it.

func (*Flags) AllowedFormats added in v0.3.0

func (f *Flags) AllowedFormats() []string

AllowedFormats is the list of formats in which data can be displayed.

func (*Flags) Copy added in v0.3.0

func (f *Flags) Copy() Flags

Copy returns a copy of Flags for mutation.

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

func (f *Flags) IsTableOutputFormat(outputFormat string) bool

IsTableOutputFormat returns true if provided output format is a table format.

func (*Flags) SetShowNamespace added in v0.3.0

func (f *Flags) SetShowNamespace(b bool)

SetShowNamespace configures whether human-readable flags return a printer capable of printing with a "namespace" column.

func (*Flags) ToPrinter added in v0.3.0

func (f *Flags) ToPrinter(client client.Interface) (Interface, error)

ToPrinter returns a printer based on current flag values.

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.

type Interface added in v0.3.0

type Interface interface {
	Print(w io.Writer, nodeMap graph.NodeMap, rootUID types.UID, maxDepth uint, depsIsDependencies bool) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL