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 int64) *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))
Click to show internal directories.
Click to hide internal directories.