kipctl

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendAllLabels

func AppendAllLabels(showLabels bool, itemLabels map[string]string) string

Append all labels to a single column. We need this even when show-labels flag* is false, since this adds newline delimiter to the end of each row.

func AppendLabels

func AppendLabels(itemLabels map[string]string, columnLabels []string) string

func CleanupResourceName

func CleanupResourceName(resource string) string

Expand nicknames and properly capitalize resource type names

func GetNewTabWriter

func GetNewTabWriter(output io.Writer) *tabwriter.Writer

GetNewTabWriter returns a tabwriter that translates tabbed columns in input into properly aligned text.

Types

type JSONPrinter

type JSONPrinter struct{}

func (*JSONPrinter) PrintObj

func (p *JSONPrinter) PrintObj(obj api.MilpaObject, w io.Writer) error

type PrettyPrinter

type PrettyPrinter struct {
	Options PrintOptions
	// contains filtered or unexported fields
}

PrettyPrinter is an implementation of ResourcePrinter which attempts to provide more elegant output. It is not threadsafe, but you may call PrintObj repeatedly; headers will only be printed if the object type changes. This makes it useful for printing items received from watches.

func NewPrettyPrinter

func NewPrettyPrinter(noHeaders, wide, showAll, showLabels, absoluteTimestamps bool, columnLabels []string) *PrettyPrinter

NewPrettyPrinter creates a PrettyPrinter.

func (*PrettyPrinter) Handler

func (h *PrettyPrinter) Handler(columns []string, printFunc interface{}) error

Handler adds a print handler with a given set of columns to PrettyPrinter instance. See validatePrintHandlerFunc for required method signature.

func (*PrettyPrinter) PrintObj

func (h *PrettyPrinter) PrintObj(obj api.MilpaObject, output io.Writer) error

type PrintOptions

type PrintOptions struct {
	NoHeaders          bool
	WithNamespace      bool
	WithKind           bool
	Wide               bool
	ShowAll            bool
	ShowLabels         bool
	AbsoluteTimestamps bool
	KindName           string
	ColumnLabels       []string
}

type ResultPrinter

type ResultPrinter interface {
	PrintObj(api.MilpaObject, io.Writer) error
}

func GetPrinter

func GetPrinter(cmd *cobra.Command) (ResultPrinter, error)

type YAMLPrinter

type YAMLPrinter struct{}

func (*YAMLPrinter) PrintObj

func (p *YAMLPrinter) PrintObj(obj api.MilpaObject, w io.Writer) error

Jump to

Keyboard shortcuts

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