bar

package
v1.0.22 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Pretty defines if use pretty print
	Pretty = true
)

Functions

This section is empty.

Types

type Container

type Container struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Container holds attributes of a bar

func New

func New() (*Container, error)

New creates a BarContainer

func (*Container) GetScreenDimensions

func (b *Container) GetScreenDimensions() (cols int, lines int)

GetScreenDimensions gets the dimensions of

func (*Container) New

func (b *Container) New(total int64, prepend string) *ProgressBar

New creates a ProgressBar

type ProgressBar

type ProgressBar struct {
	Container   *Container
	Progress    int64
	Total       int64
	Speed       float64
	StartTime   time.Time
	CurrentTime time.Time
	Prepend     string
	// contains filtered or unexported fields
}

ProgressBar holds attributes of a bar

func (*ProgressBar) IncrBy

func (p *ProgressBar) IncrBy(delta int64)

IncrBy increate progress by an number

func (*ProgressBar) Write

func (p *ProgressBar) Write(bs []byte) (n int, err error)

Write implement io.Writer

Jump to

Keyboard shortcuts

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