Documentation
¶
Overview ¶
Package pretty provides utilities for beautifying console output.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Progress ¶ added in v1.0.3
type Progress struct {
// contains filtered or unexported fields
}
Progress represents a progress bar in the terminal.
func NewProgress ¶ added in v1.0.3
func NewProgress() *Progress
NewProgress creates a new Progress instance.
type ProgressWriter ¶ added in v1.0.3
type ProgressWriter struct {
// contains filtered or unexported fields
}
ProgressWriter is an io.Writer that updates a progress bar as data is written.
func NewProgressWriter ¶ added in v1.0.3
func NewProgressWriter(n uint64) *ProgressWriter
NewProgressWriter creates a new ProgressWriter for a task of the given size.
For example, to display progress while reading from a reader:
reader := io.TeeReader(io.LimitReader(os.Stdin, 1024), NewProgressWriter(1024))
Or to display progress while writing to a writer:
writer := io.MultiWriter(os.Stdout, NewProgressWriter(1024))
type Table ¶ added in v1.0.3
type Table struct {
// Conf specifies the alignment for each column: "<" for left, ">" for right.
// If conf has fewer entries than head, the remaining columns default to left alignment ("<").
Conf []string
// Head represents the head of the table.
Head []string
// Body represents the body of the table.
Body [][]string
}
Table represents a table structure with a head and body.
Click to show internal directories.
Click to hide internal directories.