Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PrintRowFunc ¶
type PrintRowFunc func(p *Printer, row interface{})
PrintRowFunc is a custom function called to print each table row.
type Printer ¶
type Printer struct { *bufio.Writer Cols []Col ColSep string // contains filtered or unexported fields }
Printer outputs data in a table format.
func NewPrinter ¶
func NewPrinter(v interface{}) *Printer
NewPrinter creates a table layout printer for v. The only currently supported data type is a slice of struct pointers.
func (*Printer) Print ¶
func (p *Printer) Print(w io.Writer, fn PrintRowFunc)
Print outputs printer data to w. If fn is specified, it is called to print each row.
type RowPrinter ¶
type RowPrinter interface {
PrintRow(p *Printer)
}
RowPrinter may be implemented by the type being printed to control its own output.
Click to show internal directories.
Click to hide internal directories.