Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProgressBar ¶
ProgressBar is a thread-safe, simple progress bar
Example ¶
bar := New(10) bar.SetMax(100) bar.SetSize(10) bar.Reset() time.Sleep(1 * time.Second) bar.Add(10)
Output: 10% |█ | [1s:9s]
func (*ProgressBar) Add ¶
func (p *ProgressBar) Add(num int) error
Add with increase the current count on the progress bar
func (*ProgressBar) Reset ¶
func (p *ProgressBar) Reset()
Reset will reset the clock that is used to calculate current time and the time left.
func (*ProgressBar) SetMax ¶
func (p *ProgressBar) SetMax(num int)
SetMax sets the total number of the progress bar
func (*ProgressBar) SetSize ¶
func (p *ProgressBar) SetSize(size int)
SetSize sets the size of the progress bar.
func (*ProgressBar) SetTheme ¶ added in v0.5.0
func (p *ProgressBar) SetTheme(theme []string)
func (*ProgressBar) SetWriter ¶ added in v0.5.0
func (p *ProgressBar) SetWriter(w io.Writer)
SetWriter will specify a different writer than os.Stdout
Click to show internal directories.
Click to hide internal directories.