printers

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextPrinter added in v0.0.2

type ContextPrinter interface {
	ResourcePrinter

	// WithOperation returns a new ContextPrinter for operation. The receiver
	// must not be mutated.
	WithOperation(operation string) ContextPrinter

	// WithContext returns a new ContextPrinter with the context values set.
	// The receiver must not be mutated.
	WithContext(context ...string) ContextPrinter
}

ContextPrinter is a ResourcePrinter that can add context to printed object information.

func NewContextPrinter added in v0.0.2

func NewContextPrinter(color, dryRun bool) ContextPrinter

NewContextPrinter creates a new ContextPrinter.

func NewDiscardingContextPrinter added in v0.0.2

func NewDiscardingContextPrinter() ContextPrinter

NewDiscardingContextPrinter creates a ContextPrinter that just discards everything.

type RecordingPrinter

type RecordingPrinter struct {
	Recorder  recorders.OperationRecorder
	Operation string
	Printer   ResourcePrinter
}

RecordingPrinter records all objects it prints.

func NewRecordingPrinter

func NewRecordingPrinter(r recorders.OperationRecorder, operation string, p ResourcePrinter) *RecordingPrinter

NewRecordingPrinter creates a new *RecordingPrinter that records all objects using r and afterwards prints them with p. The returned printer must only print objects for the given operation.

func (*RecordingPrinter) PrintObj

func (p *RecordingPrinter) PrintObj(obj runtime.Object, w io.Writer) error

PrintObj implements ResourcePrinter.

type ResourcePrinter

type ResourcePrinter interface {
	// Print receives a runtime object, formats it and prints it to a writer.
	PrintObj(obj runtime.Object, w io.Writer) error
}

ResourcePrinter prints runtime objects.

func NewColorPrinter added in v0.0.2

func NewColorPrinter(delegate ResourcePrinter, operation string) ResourcePrinter

NewColorPrinter wraps delegate with a color printer for given operation.

Jump to

Keyboard shortcuts

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