printer

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 7 Imported by: 7

Documentation

Overview

Package printer implements printing functionality for cli.

Index

Constants

View Source
const (
	// PrinterTypeTable is a table printer PType.
	PrinterTypeTable = PType("table")
	// PrinterTypeJSON is a json printer PType.
	PrinterTypeJSON = PType("json")
)

Variables

View Source
var (
	// ErrUnknowPrinterType is an error if a printer type isn't known.
	ErrUnknowPrinterType = errors.New("unknown printer type")
	// ErrTableRequired is an error if the object being printed
	// isn't a metav1.Table.
	ErrTableRequired = errors.New("metav1.Table is required")
)

Functions

This section is empty.

Types

type PType

type PType string

PType is a type declaration for a printer type.

func (*PType) Set

func (p *PType) Set(s string) error

Set sets value for var.

func (*PType) String

func (p *PType) String() string

String type casts to string.

func (*PType) Type

func (p *PType) Type() string

Type returns type in string format.

type Printer

type Printer interface {
	// Print is a method to print an object.
	Print(in interface{}) error
}

Printer is an interface for a printer.

func New

func New(printerType PType, writer io.Writer) (Printer, error)

New creates a new printer.

Jump to

Keyboard shortcuts

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