Documentation
¶
Overview ¶
Package progress implements a small byte-progress meter on top of charm.land/bubbles/v2/progress, for use in place of github.com/schollz/progressbar/v3.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bytes ¶
type Bytes struct {
// contains filtered or unexported fields
}
Bytes is an io.WriteCloser that renders a labeled progress bar to os.Stderr as bytes are written through it. Wrap it around a transfer with io.MultiWriter (for an io.Writer destination) or io.TeeReader (for an io.Reader source).
If total is <= 0 (e.g. the size wasn't known ahead of time), Bytes falls back to reporting only the count of bytes transferred, since a percentage can't be computed.
If os.Stderr isn't a terminal, Bytes prints an occasional plain text status line instead of redrawing a bar in place, so piped or logged output isn't filled with redraw escape codes.
func NewBytes ¶
NewBytes returns a Bytes progress meter for a transfer of total bytes (pass <= 0 if the size isn't known ahead of time), labeled with description.