cli

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Printer

type Printer struct {
	// contains filtered or unexported fields
}

func NewPrinter

func NewPrinter(opts ...PrinterOption) *Printer

NewPrinter takes a variadic slice of PrinterOptions and returns a configured Printer instance.

func (*Printer) PrintTable

func (p *Printer) PrintTable(t cmd.Table) error

func (*Printer) PrintfErr

func (p *Printer) PrintfErr(s string, args ...any) error

func (*Printer) PrintfOut

func (p *Printer) PrintfOut(s string, args ...any) error

type PrinterConfig

type PrinterConfig struct {
	Out io.Writer
	Err io.Writer
}

func (*PrinterConfig) Default

func (c *PrinterConfig) Default()

func (*PrinterConfig) Option

func (c *PrinterConfig) Option(opts ...PrinterOption)

type PrinterOption

type PrinterOption interface {
	ConfigurePrinter(*PrinterConfig)
}

type WithErr

type WithErr struct{ Err io.Writer }

WithErr configures the Err stream to the given io.Writer implementations.

func (WithErr) ConfigurePrinter

func (w WithErr) ConfigurePrinter(c *PrinterConfig)

type WithOut

type WithOut struct{ Out io.Writer }

WithOut configures the Out stream to the given io.Writer implementations.

func (WithOut) ConfigurePrinter

func (w WithOut) ConfigurePrinter(c *PrinterConfig)

Jump to

Keyboard shortcuts

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