Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Stdout defines where output gets printed to Stdout io.Writer = os.Stdout // BarFormat defines the bar design BarFormat = "[#>-]" )
Functions ¶
This section is empty.
Types ¶
type MultiProgressBar ¶
type MultiProgressBar struct { ProgressBars []*ProgressBar // contains filtered or unexported fields }
MultiProgressBar is a helper for printing multiple progress bars
func (*MultiProgressBar) AddProgressBar ¶
func (mp *MultiProgressBar) AddProgressBar(p *ProgressBar)
AddProgressBar adds another progress bar to the multi struct
func (*MultiProgressBar) LazyPrint ¶
func (mp *MultiProgressBar) LazyPrint()
LazyPrint writes all progress bars to stdout if a significant update occurred
func (*MultiProgressBar) Print ¶
func (mp *MultiProgressBar) Print()
Print writes all progress bars to stdout
type ProgressBar ¶
type ProgressBar struct { // Text displayed on the very left Text string // Text prepending the bar PrependText string // Max value (100%) Total int64 // Current progress value Current int64 // Desired bar width Width uint // If a PrependTextFunc is set, the PrependText will be automatically // generated on every print PrependTextFunc func(p *ProgressBar) string // contains filtered or unexported fields }
ProgressBar is a helper for printing a progress bar
func (*ProgressBar) Clear ¶ added in v0.2.0
func (p *ProgressBar) Clear()
Clear deletes everything on the current terminal line, hence removing a printed progressbar
func (*ProgressBar) LazyPrint ¶
func (p *ProgressBar) LazyPrint()
LazyPrint writes the progress bar to stdout if a significant update occurred
func (*ProgressBar) UpdateRequired ¶
func (p *ProgressBar) UpdateRequired() bool
UpdateRequired returns true when this progressbar wants an update regardless of fps limitation
Click to show internal directories.
Click to hide internal directories.