progressbar

package
v0.1.73 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 12 Imported by: 3

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 is a simple progress bar.

func New

func New(total int) *ProgressBar

New returns a new ProgressBar with default options.

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

func (pb *ProgressBar) Cancel()

Cancel cancels the progress bar.

func (*ProgressBar) Done

func (pb *ProgressBar) Done()

Done waits the progress bar finished.

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

func (pb *ProgressBar) SetRefresh(refresh time.Duration) *ProgressBar

SetRefresh sets progress bar refresh time for check speed.

func (*ProgressBar) SetTemplate

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

SetTemplate sets progress bar template.

func (*ProgressBar) SetUnit

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

SetUnit sets progress bar unit.

func (*ProgressBar) SetWidth

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

SetWidth sets progress bar block width.

func (*ProgressBar) Start

func (pb *ProgressBar) Start() error

Start starts the progress bar.

Jump to

Keyboard shortcuts

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