progressbar

package
v2.54.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRemaining added in v2.53.0

func NewRemaining(style decor.TimeStyle, endTime time.Time, wcc ...decor.WC) decor.Decorator

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

func Remaining added in v2.53.0

func Remaining(endTime time.Time, style decor.TimeStyle, wcc ...decor.WC) decor.Decorator

Remaining decorator. It's wrapper of NewRemaining.

`style` one of [ET_STYLE_GO|ET_STYLE_HHMMSS|ET_STYLE_HHMM|ET_STYLE_MMSS]

`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

func NewMultiProgressBar(w io.Writer, total, numBars int, name string, enable bool) *ProgressBar

NewMultiProgressBar create a new progress bar to display progress of workers and an overall progress

func (*ProgressBar) Completed

func (p *ProgressBar) Completed()

Completed set overall completed

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) Wait

func (p *ProgressBar) Wait()

Wait waits for the progress bar to finish

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL