columnwriter

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 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 BarColumn added in v0.0.9

type BarColumn string

func (BarColumn) FlushLine added in v0.0.9

func (c BarColumn) FlushLine(w io.Writer, lineNr int, lastColumn bool) error

func (BarColumn) Lines added in v0.0.9

func (c BarColumn) Lines() int

func (BarColumn) PreFlush added in v0.0.9

func (c BarColumn) PreFlush()

func (BarColumn) Reset added in v0.0.9

func (c BarColumn) Reset()

func (BarColumn) Write added in v0.0.9

func (c BarColumn) Write(p []byte) (int, error)

type Column

type Column interface {
	io.Writer
	Lines() int
	PreFlush()
	FlushLine(w io.Writer, lines int, lastColumn bool) error
	Reset()
}

type MultiLineColumn added in v0.0.9

type MultiLineColumn struct {
	Width   int
	Wrap    bool
	LenFn   func(s string) int
	SliceFn func(s string, start, stop int) string
	// contains filtered or unexported fields
}

func (*MultiLineColumn) FlushLine added in v0.0.9

func (c *MultiLineColumn) FlushLine(w io.Writer, lineNr int, lastColumn bool) error

func (*MultiLineColumn) Lines added in v0.0.9

func (c *MultiLineColumn) Lines() int

func (*MultiLineColumn) PreFlush added in v0.0.9

func (c *MultiLineColumn) PreFlush()

func (*MultiLineColumn) Reset added in v0.0.9

func (c *MultiLineColumn) Reset()

func (*MultiLineColumn) Write added in v0.0.9

func (c *MultiLineColumn) Write(p []byte) (int, error)

type Writer

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

Writer maintins multiple column io.Writer:s. On Flush() row align them.

func New

func New(w io.Writer, columns ...Column) *Writer

func (*Writer) Flush

func (w *Writer) Flush() error

Jump to

Keyboard shortcuts

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