progbar

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoOp

type NoOp struct{}

NoOp is a progress bar that does not draw anything.

func NewNoOp

func NewNoOp() *NoOp

NewNoOp returns a new NoOp progress bar. NoOp progress bar does nothing.

func (*NoOp) SetCurrent

func (n *NoOp) SetCurrent(cur int64)

SetCurrent sets the current value.

func (*NoOp) SetMax

func (n *NoOp) SetMax(max int64)

SetMax sets the max value.

type ProgressBar

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

ProgressBar handles a progress bar drawing on a terminal.

func New

func New(ctx context.Context, desc string) *ProgressBar

New returns a new ProgressBar using the provided description as the bar label.

func (*ProgressBar) Abort

func (p *ProgressBar) Abort()

Abort cancels the progress bar.

func (*ProgressBar) SetCurrent

func (p *ProgressBar) SetCurrent(cur int64)

SetCurrent sets the current value of the ProgressBar.

func (*ProgressBar) SetMax

func (p *ProgressBar) SetMax(max int64)

SetMax sets the max value for the ProgressBar.

func (*ProgressBar) Wait

func (p *ProgressBar) Wait()

Wait awaits for the ProgressBar to finish drawing.

Jump to

Keyboard shortcuts

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