Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bar ¶
type Bar interface {
UpdateDisplay(newDisplay *DisplayProps)
}
Bar controls how a bar is displayed, for both single bar or multi bar item.
type DisplayProps ¶
type DisplayProps struct { Prefix string Suffix string // If `Mode == Done / Error`, Suffix is not printed Mode Mode }
DisplayProps controls the display of the progress bar.
type MultiBar ¶
type MultiBar struct {
// contains filtered or unexported fields
}
MultiBar renders multiple progress bars.
func (*MultiBar) AddBar ¶
func (b *MultiBar) AddBar(prefix string) *MultiBarItem
AddBar adds a new bar item. This function is not thread safe. Must be called before render loop is started.
func (*MultiBar) StartRenderLoop ¶
func (b *MultiBar) StartRenderLoop()
StartRenderLoop starts the render loop. This function is thread safe.
func (*MultiBar) StopRenderLoop ¶
func (b *MultiBar) StopRenderLoop()
StopRenderLoop stops the render loop. This function is thread safe.
type MultiBarItem ¶
type MultiBarItem struct {
// contains filtered or unexported fields
}
MultiBarItem controls a bar item inside MultiBar.
func (*MultiBarItem) UpdateDisplay ¶
func (i *MultiBarItem) UpdateDisplay(newDisplay *DisplayProps)
UpdateDisplay updates the display property of this bar item. This function is thread safe.
type SingleBar ¶
type SingleBar struct {
// contains filtered or unexported fields
}
SingleBar renders single progress bar.
func NewSingleBar ¶
NewSingleBar creates a new SingleBar.
func (*SingleBar) StartRenderLoop ¶
func (b *SingleBar) StartRenderLoop()
StartRenderLoop starts the render loop. This function is thread safe.
func (*SingleBar) StopRenderLoop ¶
func (b *SingleBar) StopRenderLoop()
StopRenderLoop stops the render loop. This function is thread safe.
func (*SingleBar) UpdateDisplay ¶
func (b *SingleBar) UpdateDisplay(newDisplay *DisplayProps)
UpdateDisplay updates the display property of this single bar. This function is thread safe.