readable

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: Apache-2.0 Imports: 20 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 NewLocalPrinter added in v1.1.0

NewLocalPrinter creates a new local printer.

func TabbedString

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

TabbedString format the input as tabbed string with pretty indent

Types

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) (kubeprinters.ResourcePrinter, error)

Jump to

Keyboard shortcuts

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