tableprinter

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StreamingTablePrinter added in v0.2.0

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

StreamingTablePrinter formats data as aligned columns with progressive output. Unlike TablePrinter, it outputs rows incrementally after determining column widths from an initial sample of rows.

func NewStreaming added in v0.2.0

func NewStreaming(out io.Writer) *StreamingTablePrinter

NewStreaming creates a new StreamingTablePrinter with default sample size.

func NewStreamingWithSample added in v0.2.0

func NewStreamingWithSample(out io.Writer, sampleSize int) *StreamingTablePrinter

NewStreamingWithSample creates a new StreamingTablePrinter with custom sample size.

func (*StreamingTablePrinter) AddRow added in v0.2.0

func (s *StreamingTablePrinter) AddRow(fields ...string) error

AddRow adds a row of fields to the table and outputs it (after sampling).

func (*StreamingTablePrinter) Flush added in v0.2.0

func (s *StreamingTablePrinter) Flush() error

Flush ensures any remaining buffered rows are output. Call this after adding all rows to ensure everything is written.

type TablePrinter

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

TablePrinter formats data as aligned columns.

func New

func New(out io.Writer) *TablePrinter

New creates a new TablePrinter.

func (*TablePrinter) AddRow

func (t *TablePrinter) AddRow(fields ...string)

AddRow adds a row of fields to the table.

func (*TablePrinter) Render

func (t *TablePrinter) Render() error

Render outputs the formatted table.

Jump to

Keyboard shortcuts

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