progress

package
v0.0.0-...-273dbd6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BarPooler

type BarPooler interface {
	Add(bar Barer)
	Start() error
	Stop() error
}

BarPooler is the interface to manipulate a lot of progress bars

type Barer

type Barer interface {
	Set(value int)
	SetTotal(total int64)
	Add(add int64)
	Increment() int64
	IncrementTotal(add int64)
	GetBar() *CheggaaBar
	Start()
	Finish()
}

Barer is the interface used to manipulate a progress Bar

type CheggaaBar

type CheggaaBar struct {
	Bar *pb.ProgressBar
}

CheggaaBar is a progress Bar implementation

func NewProgressBar

func NewProgressBar(title string) *CheggaaBar

NewProgressBar is the constructor

func (*CheggaaBar) Add

func (pb *CheggaaBar) Add(add int64)

Add allows to increase the current progress

func (*CheggaaBar) Finish

func (pb *CheggaaBar) Finish()

Finish stops the progress bar

func (*CheggaaBar) GetBar

func (pb *CheggaaBar) GetBar() *CheggaaBar

GetBar returns all the structure

func (*CheggaaBar) Increment

func (pb *CheggaaBar) Increment() int64

Increment allows to increment the current progress

func (*CheggaaBar) IncrementTotal

func (pb *CheggaaBar) IncrementTotal(add int64)

IncrementTotal allows to increase the total progress bar

func (*CheggaaBar) Set

func (pb *CheggaaBar) Set(value int)

Set allows to reset the current progress of the progress bar

func (*CheggaaBar) SetTotal

func (pb *CheggaaBar) SetTotal(total int64)

SetTotal is the total setter

func (*CheggaaBar) Start

func (pb *CheggaaBar) Start()

Start starts the progress bar

type CheggaaaPool

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

CheggaaaPool is a progress Bar pool implementation

func (*CheggaaaPool) Add

func (p *CheggaaaPool) Add(bar Barer)

Add registers a new progress bar

func (*CheggaaaPool) Start

func (p *CheggaaaPool) Start() error

Start launch all registered progress bars

func (*CheggaaaPool) Stop

func (p *CheggaaaPool) Stop() error

Stop stops the pool

Jump to

Keyboard shortcuts

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