Documentation ¶
Index ¶
- func AppendAllLabels(showLabels bool, itemLabels map[string]string) string
- func AppendLabels(itemLabels map[string]string, columnLabels []string) string
- func CleanupResourceName(resource string) string
- func GetNewTabWriter(output io.Writer) *tabwriter.Writer
- type JSONPrinter
- type PrettyPrinter
- type PrintOptions
- type ResultPrinter
- type YAMLPrinter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendAllLabels ¶
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 CleanupResourceName ¶
Expand nicknames and properly capitalize resource type names
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 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