printers

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2018 License: MIT Imports: 14 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) PrintDeviceDetails added in v0.2.3

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

PrintDeviceDetails writes a dvice in human readable detailed format to the writer

func (*HumanReadablePrinter) PrintDevicesTable

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

PrintDevicesTable writes stream of Devices in human readable table format to the writer

func (*HumanReadablePrinter) PrintPodDetails

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

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

func (*HumanReadablePrinter) PrintPodsTable

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

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

type ResourcePrinter

type ResourcePrinter interface {
	// PrintPodsTable receives a list of Pods, formats it as table and prints it to a writer.
	PrintPodsTable([]*pods.Pod, io.Writer) error
	// PrintDevicesTable receives a channel of Devices, formats the output as table
	PrintDevicesTable([]model.DeviceInfo, io.Writer) error
	// PrintDeviceDetails receives a Device, formats it to detailed description and prints it to the writer.
	PrintDeviceDetails(*device.Info, io.Writer) error
	// PrintPodDetails receives a Pod, formats it to detailed description and prints it to the writer.
	PrintPodDetails(*pods.Pod, io.Writer) error
	// PrintConfig receives config and formats it to human readable format
	PrintConfig(*config.Config, io.Writer) error
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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