Documentation
¶
Index ¶
- func NewRemaining(style decor.TimeStyle, endTime time.Time, wcc ...decor.WC) decor.Decorator
- func Remaining(endTime time.Time, style decor.TimeStyle, wcc ...decor.WC) decor.Decorator
- type CountdownProgressBar
- type ProgressBar
- func (p *ProgressBar) Completed()
- func (p *ProgressBar) FinishedJob(w int, startTime time.Time)
- func (p *ProgressBar) IncrementOverviewCurrent()
- func (p *ProgressBar) IncrementOverviewTotal()
- func (p *ProgressBar) IncrementWorkerTotal(w int, total int64)
- func (p *ProgressBar) IsEnabled() bool
- func (p *ProgressBar) IsRunning() bool
- func (p *ProgressBar) RefreshRate() time.Duration
- func (p *ProgressBar) Start(age float64)
- func (p *ProgressBar) StartJob(w int, total int64) time.Time
- func (p *ProgressBar) Wait()
- func (p *ProgressBar) WorkerCompleted(w int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRemaining ¶ added in v2.53.0
NewRemaining returns remaining time decorator.
`style` one of [ET_STYLE_GO|ET_STYLE_HHMMSS|ET_STYLE_HHMM|ET_STYLE_MMSS] `endTime` end time `wcc` optional WC config
Types ¶
type CountdownProgressBar ¶ added in v2.53.0
type CountdownProgressBar struct {
TaskName string
StartedAt time.Time
ExpiresAt time.Time
Duration time.Duration
// contains filtered or unexported fields
}
CountdownProgressBar progress bar to show a countdown
func NewCountdownProgressBar ¶ added in v2.53.0
func NewCountdownProgressBar(w io.Writer, duration time.Duration, name string, enable bool) *CountdownProgressBar
NewCountdownProgressBar create a new progress bar to display countdown timer
func (*CountdownProgressBar) IsEnabled ¶ added in v2.53.0
func (p *CountdownProgressBar) IsEnabled() bool
IsEnabled check if the progress bar is enabled or not.
func (*CountdownProgressBar) IsRunning ¶ added in v2.53.0
func (p *CountdownProgressBar) IsRunning() bool
IsRunning check if the progress bar is running or not (aka. has started)
func (*CountdownProgressBar) RefreshRate ¶ added in v2.53.0
func (p *CountdownProgressBar) RefreshRate() time.Duration
RefreshRate returns the configured refresh rate of the progress bar
func (*CountdownProgressBar) Start ¶ added in v2.53.0
func (p *CountdownProgressBar) Start()
Start start displaying the progress bar
func (*CountdownProgressBar) UpdateValue ¶ added in v2.53.0
func (p *CountdownProgressBar) UpdateValue(l string)
func (*CountdownProgressBar) Wait ¶ added in v2.53.0
func (p *CountdownProgressBar) Wait()
Wait waits for the progress bar to finish
type ProgressBar ¶
type ProgressBar struct {
Bars []*mpb.Bar
TaskName string
NumBars int
// contains filtered or unexported fields
}
ProgressBar Multi progress bar
func NewMultiProgressBar ¶
NewMultiProgressBar create a new progress bar to display progress of workers and an overall progress
func (*ProgressBar) FinishedJob ¶
func (p *ProgressBar) FinishedJob(w int, startTime time.Time)
FinishedJob finish a job and record the time since the job started (if StartJob was called)
func (*ProgressBar) IncrementOverviewCurrent ¶
func (p *ProgressBar) IncrementOverviewCurrent()
IncrementOverviewTotal increment the current overview value by 1
func (*ProgressBar) IncrementOverviewTotal ¶
func (p *ProgressBar) IncrementOverviewTotal()
IncrementOverviewTotal increment the overview total by 1
func (*ProgressBar) IncrementWorkerTotal ¶
func (p *ProgressBar) IncrementWorkerTotal(w int, total int64)
IncrementWorkerTotal increments the worker total by 1
func (*ProgressBar) IsEnabled ¶
func (p *ProgressBar) IsEnabled() bool
IsEnabled check if the progress bar is enabled or not.
func (*ProgressBar) IsRunning ¶
func (p *ProgressBar) IsRunning() bool
IsRunning check if the progress bar is running or not (aka. has started)
func (*ProgressBar) RefreshRate ¶
func (p *ProgressBar) RefreshRate() time.Duration
RefreshRate returns the configured refresh rate of the progress bar
func (*ProgressBar) Start ¶
func (p *ProgressBar) Start(age float64)
Start start displaying the progress bar
func (*ProgressBar) StartJob ¶
func (p *ProgressBar) StartJob(w int, total int64) time.Time
StartJob starts a job for a given worker. It will record the time it started the job, and the duration will be used in calculated once FinishedJob is called.
func (*ProgressBar) WorkerCompleted ¶
func (p *ProgressBar) WorkerCompleted(w int)
WorkerCompleted marks a worker as completed. The current total will be used as its final value