printer

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Object

type Object struct {
	Fields    map[string]interface{}
	K8sObject interface{}
}

Object is a structure that contain k8s object and field descriptions that should be printed

type Printer

type Printer struct {
	Format string
	Output io.Writer
	Table  *tablewriter.Table
}

Printer structure contains information needed to print objects in "tm get" command

func NewPrinter

func NewPrinter(out io.Writer) *Printer

NewPrinter returns new Printer instance

func (*Printer) PrintObject

func (p *Printer) PrintObject(object Object) error

PrintObject accepts Object instance and depending on output format encodes object and writes to Object output

func (*Printer) PrintTable

func (p *Printer) PrintTable(table Table)

PrintTable accepts Table instance and prints it using olekukonko/tablewriter package

type Table

type Table struct {
	Headers headers
	Rows    rows
}

Table is a structure with list headers and data rows that can be printed in PrintTable method

Jump to

Keyboard shortcuts

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