readable

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package readable provides types and utils for human readable output

Index

Constants

View Source
const (
	LEVEL_0 = iota
	LEVEL_1
	LEVEL_2
	LEVEL_3
)

Indent level for PrefixWriter

Variables

This section is empty.

Functions

func AddHandlers

func AddHandlers(h printers.PrintHandler)

func TabbedString

func TabbedString(f func(io.Writer) error) (string, error)

TabbedString format the input as tabbed string with pretty indent

Types

type PodBasicColumns

type PodBasicColumns struct {
	Name     string
	Ready    string
	Reason   string
	Restarts int64
	Memory   string
	Age      string
	PodIP    string
	NodeName string

	MemInfo string
	CPUInfo string
}

PodBasicColumns holds common columns for all kinds of pod

type PrefixWriter

type PrefixWriter interface {
	// Write writes text with the specified indentation level.
	Write(level int, format string, a ...interface{})

	// WriteLine writes line with the specified indentation level.
	WriteLine(level int, format string, a ...interface{})
}

PrefixWriter can write text at various indentation levels

func NewPrefixWriter

func NewPrefixWriter(out io.Writer) PrefixWriter

NewPrefixWriter creates a new PrefixWriter.

type PrintFlags

type PrintFlags struct {
	JSONYamlPrintFlags *genericclioptions.JSONYamlPrintFlags
	OutputFormat       string
}

func NewPrintFlags

func NewPrintFlags() *PrintFlags

func (*PrintFlags) AddFlags

func (p *PrintFlags) AddFlags(cmd *cobra.Command)

func (*PrintFlags) ToPrinter

func (p *PrintFlags) ToPrinter(withKind, withNamespace bool) (printers.ResourcePrinter, error)

Jump to

Keyboard shortcuts

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