table

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column added in v0.14.0

type Column struct {
	Name string

	// Maximum column length (if unspecified then output won't be truncated)
	MaxLength int
}

type Printer

type Printer struct {
	Columns []Column
	// contains filtered or unexported fields
}

func (*Printer) Add added in v0.14.0

func (p *Printer) Add(values ...interface{})

Add a new row consisting of values to be printed. The value will be cast to string, with special care given to bool and slice. It's up to the caller to ensure the number of values match the nubmer of table columns.

func (*Printer) Empty added in v0.14.0

func (p *Printer) Empty() bool

Empty will be true if there aren't any rows to print.

func (*Printer) Print

func (p *Printer) Print()

Print out the table; if it's empty then nothing gets printed.

Jump to

Keyboard shortcuts

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