Documentation ¶
Overview ¶
Package pogs provides thread-safe methods for displaying multiple progress bars in unix terminals.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bars ¶
type Bars struct {
// contains filtered or unexported fields
}
Bars controls a group of progress bars.
func NewBars ¶
NewBars instanciates a Bars struct. NewBars returns an error if it is unable to get the terminal width.
func (*Bars) Done ¶
func (b *Bars) Done()
Done tells the Bars struct that the user is done creating progress bars with Bars.NewBar. When all progress bars are complete, the cursor will move to the bottom and print a newline character for the next write to stdout to appear on a new line.
func (*Bars) NewBar ¶
NewBar creates a new progress bar and returns an index to pass to Bars.Add and Bars.Start. The progress bar is created but not displayed until called with Bars.Start.
The index is always the i-th progress bar created, starting at 0. If your program already keeps track of an index per progress bar (eg. creating one progress bar per iteration in an index-based loop), you may use it instead.
NewBar returns an error if Bars.Done has been called.