printers

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2018 License: MIT Imports: 15 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNewTabWriter

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

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

Types

type HumanReadablePrinter

type HumanReadablePrinter struct {
}

HumanReadablePrinter is an implementation of ResourcePrinter which prints resources in human readable format (tables etc.).

func NewHumanReadablePrinter

func NewHumanReadablePrinter() *HumanReadablePrinter

NewHumanReadablePrinter creates new HumanReadablePrinter

func (*HumanReadablePrinter) PrintConfig

func (p *HumanReadablePrinter) PrintConfig(config *config.Config, writer io.Writer) error

PrintConfig writes list of pods in human readable detailed format to the writer

func (*HumanReadablePrinter) PrintDevice added in v0.2.4

func (p *HumanReadablePrinter) PrintDevice(info *device.Info, writer io.Writer) error

PrintDevice writes a device in human readable detailed format to the writer

func (*HumanReadablePrinter) PrintDevices added in v0.2.4

func (p *HumanReadablePrinter) PrintDevices(devices []model.DeviceInfo, writer io.Writer) error

PrintDevices writes list of Devices in human readable table format to the writer

func (*HumanReadablePrinter) PrintPod added in v0.2.4

func (p *HumanReadablePrinter) PrintPod(pod *pods.Pod, writer io.Writer) error

PrintPod writes a pod in human readable detailed format to the writer

func (*HumanReadablePrinter) PrintPods added in v0.2.4

func (p *HumanReadablePrinter) PrintPods(pods []*pods.Pod, writer io.Writer) error

PrintPods writes list of Pods in human readable table format to the writer

type ResourcePrinter

type ResourcePrinter interface {
	PrintPods([]*pods.Pod, io.Writer) error
	PrintDevices([]model.DeviceInfo, io.Writer) error
	PrintDevice(*device.Info, io.Writer) error
	PrintPod(*pods.Pod, io.Writer) error
	PrintConfig(*config.Config, io.Writer) error
}

ResourcePrinter is an interface that knows how to print runtime objects.

type YamlPrinter added in v0.2.4

type YamlPrinter struct {
}

YamlPrinter is ResourcePrinter implementation which writes output in YAML format

func NewYamlPrinter added in v0.2.4

func NewYamlPrinter() *YamlPrinter

NewYamlPrinter creates new YamlPrinter instance

func (*YamlPrinter) PrintConfig added in v0.2.4

func (p *YamlPrinter) PrintConfig(config *config.Config, w io.Writer) error

PrintConfig takes Config and prints to Writer in YAML format

func (*YamlPrinter) PrintDevice added in v0.2.4

func (p *YamlPrinter) PrintDevice(device *device.Info, w io.Writer) error

PrintDevice takes device info and prints to Writer in YAML format

func (*YamlPrinter) PrintDevices added in v0.2.4

func (p *YamlPrinter) PrintDevices(devices []model.DeviceInfo, w io.Writer) error

PrintDevices takes list of devices and prints to Writer in YAML format

func (*YamlPrinter) PrintPod added in v0.2.4

func (p *YamlPrinter) PrintPod(pod *pods.Pod, w io.Writer) error

PrintPod takes Pod and prints to Writer in YAML format

func (*YamlPrinter) PrintPods added in v0.2.4

func (p *YamlPrinter) PrintPods(pods []*pods.Pod, w io.Writer) error

PrintPods takes list of pods and prints to Writer in YAML format

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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