output

package
v0.1.52 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 License: Apache-2.0 Imports: 6 Imported by: 1

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
}

Printer knows how to write output text.

func (*Printer) Close

func (p *Printer) Close() error

Close releases all the resources used by the printer.

func (*Printer) Write

func (p *Printer) Write(b []byte) (n int, err error)

Write is the implementation of the io.Writer interface.

type PrinterBuilder

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

PrinterBuilder contains the data and logic needed to create new printers.

func NewPrinter

func NewPrinter() *PrinterBuilder

NewPrinter creates a builder that can then be used to configure and create a printer.

func (*PrinterBuilder) Build

func (b *PrinterBuilder) Build(ctx context.Context) (result *Printer, err error)

Build uses the data stored in the builder to create a new printer.

func (*PrinterBuilder) Paging

func (b *PrinterBuilder) Paging(value bool) *PrinterBuilder

Paging enables or disables paging of results. If enabled the and the command line `less` tool is available, it will be used to display the output page by page. The default value is true, so paging is enabled by default.

func (*PrinterBuilder) Writer

func (b *PrinterBuilder) Writer(value io.Writer) *PrinterBuilder

Writer sets the writer where the printer will write. It will usually be a file or the standard output fo the process. This is mandatory.

Jump to

Keyboard shortcuts

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