progressbar

package
v0.1.80 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProgressBar

type ProgressBar struct {
	// contains filtered or unexported fields
}

ProgressBar represents a customizable progress bar for tracking task progress. It supports configurable templates, units, and refresh intervals.

func New

func New(total int) *ProgressBar

New creates a new ProgressBar with the specified total count and default options. It panics if total is less than or equal to zero.

func New64

func New64(total int64) *ProgressBar

New64 returns a new ProgressBar with default options.

func (*ProgressBar) Add

func (pb *ProgressBar) Add(n int64)

Add adds the specified amount to the progress bar.

func (*ProgressBar) Additional added in v0.1.77

func (pb *ProgressBar) Additional(s string)

Additional adds the specified string to the progress bar.

func (*ProgressBar) Cancel

func (pb *ProgressBar) Cancel()

Cancel cancels the progress bar.

func (*ProgressBar) Done

func (pb *ProgressBar) Done()

Done waits the progress bar finished. Same as ProgressBar.Wait().

func (*ProgressBar) FromReader

func (pb *ProgressBar) FromReader(r io.Reader, w io.Writer) (int64, error)

FromReader starts the progress bar from a reader.

func (*ProgressBar) Message added in v0.1.80

func (pb *ProgressBar) Message(msg string) error

Message sets a message to be displayed on the progress bar.

func (*ProgressBar) SetRefreshInterval added in v0.1.80

func (pb *ProgressBar) SetRefreshInterval(interval time.Duration) *ProgressBar

SetRefreshInterval sets progress bar refresh interval time for check speed. It panics if called after the progress bar has started or if interval is less than or equal to zero.

func (*ProgressBar) SetRenderInterval added in v0.1.80

func (pb *ProgressBar) SetRenderInterval(interval time.Duration) *ProgressBar

SetRenderInterval sets the interval for updating the progress bar display. It panics if called after the progress bar has started or if interval is less than or equal to zero.

func (*ProgressBar) SetTemplate

func (pb *ProgressBar) SetTemplate(tmplt string) error

SetTemplate sets progress bar template.

func (*ProgressBar) SetUnit

func (pb *ProgressBar) SetUnit(unit string) *ProgressBar

SetUnit sets progress bar unit. It panics if called after the progress bar has started.

func (*ProgressBar) SetWidth

func (pb *ProgressBar) SetWidth(blockWidth int) *ProgressBar

SetWidth sets the progress bar block width. It panics if called after the progress bar has started or if blockWidth is less than or equal to zero.

func (*ProgressBar) Start

func (pb *ProgressBar) Start() error

Start starts the progress bar.

func (*ProgressBar) Wait added in v0.1.80

func (pb *ProgressBar) Wait()

Wait blocks until the progress bar is finished.

Jump to

Keyboard shortcuts

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