Documentation
¶
Index ¶
- type ProgressManager
- func (p *ProgressManager) Bprintf(format string, a ...interface{}) (int, error)
- func (p *ProgressManager) Bprintln(a ...interface{}) (int, error)
- func (p *ProgressManager) ClearLine()
- func (p *ProgressManager) Finish()
- func (p *ProgressManager) Increment()
- func (p *ProgressManager) RenderBlank()
- func (p *ProgressManager) SetMessage(description string)
- func (p *ProgressManager) SetTotal(total int)
- func (p *ProgressManager) Write(data []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProgressManager ¶
type ProgressManager struct {
// contains filtered or unexported fields
}
func NewProgressBar ¶
func NewProgressBar(total int, description string) *ProgressManager
NewProgressBar creates a progress bar with a fixed width and padded/truncated description
func (*ProgressManager) Bprintf ¶
func (p *ProgressManager) Bprintf(format string, a ...interface{}) (int, error)
Bprintf prints a formatted message above the bar.
func (*ProgressManager) Bprintln ¶
func (p *ProgressManager) Bprintln(a ...interface{}) (int, error)
Bprintln prints a message on its own clean line above the bar, then redraws the bar. We do not delegate to progressbar.Bprintln because its clear is a no-op until the bar has measured its width, which races the throttled render and leaves the message glued to the end of the bar line.
func (*ProgressManager) ClearLine ¶
func (p *ProgressManager) ClearLine()
ClearLine clears the current console line.
func (*ProgressManager) Finish ¶
func (p *ProgressManager) Finish()
Finish completes the bar and prints a newline.
func (*ProgressManager) Increment ¶
func (p *ProgressManager) Increment()
Increment increases the current progress by one.
func (*ProgressManager) RenderBlank ¶
func (p *ProgressManager) RenderBlank()
RenderBlank renders an empty bar state.
func (*ProgressManager) SetMessage ¶
func (p *ProgressManager) SetMessage(description string)
SetMessage updates the bar's description, padded/truncated to fixed width.
func (*ProgressManager) SetTotal ¶
func (p *ProgressManager) SetTotal(total int)
SetTotal updates the maximum count of the progress bar.