columnwriter

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 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 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