Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatBytes ¶
FormatBytes returns a human-readable byte string (e.g. "12.3 MB").
Types ¶
type ProgressBar ¶
type ProgressBar struct {
// contains filtered or unexported fields
}
ProgressBar tracks and renders download progress to stderr.
func NewProgressBar ¶
func NewProgressBar(total int64, desc string) *ProgressBar
NewProgressBar creates a new progress bar. If total <= 0, it renders without a bar.
func (*ProgressBar) Add ¶
func (p *ProgressBar) Add(n int64)
Add advances the progress bar by n bytes.
func (*ProgressBar) Finish ¶
func (p *ProgressBar) Finish()
Finish renders the final state with a newline.