printer

package
v0.0.0-...-6783019 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OutputPrinterYAML  = OutputPrinter("yaml")
	OutputPrinterJSON  = OutputPrinter("json")
	OutputPrinterTable = OutputPrinter("table")

	SupportedPrinters = []OutputPrinter{OutputPrinterYAML, OutputPrinterJSON, OutputPrinterTable}

	ErrUnknownPrinterOutput = errors.New("unknown printer output type. Supported types are yaml, json, table")
	ErrTableRequired        = errors.New("table printer can only be used with a metav1.Table")
)

Functions

func ConvertSliceToTable

func ConvertSliceToTable(columnName string, items []string) *metav1.Table

ConvertSliceToTable will convert a string slice to a table

Types

type ObjectPrinter

type ObjectPrinter interface {
	Print(in interface{}, writer io.Writer) error
}

func New

func New(outputPrinter OutputPrinter) (ObjectPrinter, error)

type OutputPrinter

type OutputPrinter string

Jump to

Keyboard shortcuts

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