tableprinter

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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