printers

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTable

func GenerateTable(responseValues []reflect.Value, responseItemType reflect.Type) (*metav1.Table, error)

GenerateTable creates a metav1.Table structure from a slice of reflect.Values and the reflection type of the item. It generates table columns and rows based on the provided data and returns the resulting metav1.Table.

func GetNewTabWriter

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

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

func PrintTable

func PrintTable(table *metav1.Table, output io.Writer) error

PrintTable prints a table to the provided output respecting the filtering rules for options for wide columns and filtered rows. It filters out rows that are Completed. You should call decorateTable if you receive a table from a remote server before calling printTable.

func WriteEscaped

func WriteEscaped(writer io.Writer, output string) error

WriteEscaped replaces unsafe terminal characters with replacement strings and writes them to the given writer.

Types

type Columns

type Columns struct {
	PrintName string
	FieldName string
}

Jump to

Keyboard shortcuts

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