Documentation ¶
Overview ¶
Package pbar implements a simple percentage-based terminal progress indicator.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bar ¶
type Bar struct {
// contains filtered or unexported fields
}
A Bar is a progress indicator. Method of a Bar are safe for concurrent use by multiple goroutines.
func New ¶
New contructs a new Bar with the given maximum value that writes a status line periodically to w. Call Start to begin updating the progress line, and Stop to stop it.
func (*Bar) Add ¶
Add addsd v to the current value of the bar. The offset may be negative. If the resulting value is less than zero it is pinned to zero. If the resulting value exceeds the current maximum the bar length is extended.
func (*Bar) Set ¶
Set sets the current value of the bar to v. If v exceeds the current maximum, the bar length is extended.