Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HumanReadableTablePrinter ¶
type HumanReadableTablePrinter struct { }
Inspired by Kubernetes
func (HumanReadableTablePrinter) PrintResource ¶
func (p HumanReadableTablePrinter) PrintResource(ctx context.Context, items types.PrintableResource, writer io.Writer) error
type JsonPrinter ¶
type JsonPrinter struct { }
func (JsonPrinter) PrintResource ¶
func (p JsonPrinter) PrintResource(ctx context.Context, r types.PrintableResource, writer io.Writer) error
type ResourcePrinter ¶
type ResourcePrinter interface { // PrintResource receives a runtime object, formats it and prints it to a writer. PrintResource(context.Context, types.PrintableResource, io.Writer) error }
Inspired by Kubernetes
ResourcePrinter is an interface that knows how to print runtime objects.
func GetPrinter ¶
func GetPrinter(cmd *cobra.Command) ResourcePrinter
type TablePrinter ¶
type TablePrinter struct {
Delegate ResourcePrinter
}
Inspired by Kubernetes TablePrinter decodes table objects into typed objects before delegating to another printer. Non-table types are simply passed through
func (TablePrinter) PrintResource ¶
func (p TablePrinter) PrintResource(ctx context.Context, items types.PrintableResource, writer io.Writer) error
type YamlPrinter ¶
type YamlPrinter struct { }
Inspired by https://github.com/goccy/go-yaml/blob/master/cmd/ycat/ycat.go
func (YamlPrinter) PrintResource ¶
func (px YamlPrinter) PrintResource(ctx context.Context, r types.PrintableResource, writer io.Writer) error
Click to show internal directories.
Click to hide internal directories.