Categorygithub.com/linxlib/pbar
modulepackage
0.0.4
Repository: https://github.com/linxlib/pbar.git
Documentation: pkg.go.dev

# README

pbar

a fancy progress bar in console

# Packages

No description provided by the author
No description provided by the author

# Functions

AddBar creates a new progress bar and adds it to the default progress container.
No description provided by the author
Stop stops listening.
New creates new Bar object.
New64 creates new Bar object using int64 as total.
New returns a new progress bar with defaults.
RegisterElement give you a chance to use custom elements.
Start starts the rendering the progress of progress bars using the DefaultProgress.
Start64 starts new Bar with Default template.
StartNew starts new Bar with Default template.
No description provided by the author
No description provided by the author

# Constants

Bytes means we're working with byte sizes.
Use SI bytes prefix names (kB, MB, etc) instead of IEC prefix names (KiB, MiB, etc).

# Variables

Bouncing dots.
No description provided by the author
Clock that spins two hours per step.
Default - preset like Full but without elapsed time Example: 'Prefix 20/100 [-->______] 20% 1 p/s ETA 1m Suffix'.
Dots that spin around a rectangle.
ElementBar make progress bar view [-->__] Optionally can take up to 5 string arguments.
ElementCounters shows current and total values.
ElementCycle return next argument for every call In template use as follows: {{cycle .
ElementElapsedTime shows elapsed time Optionally cat take one argument - it's format for time string.
ElementPercent shows current percent of progress.
ElementRemainingTime calculates remaining time based on speed (EWMA) Optionally can take one or two string arguments.
ElementSpeed calculates current speed by EWMA Optionally can take one or two string arguments.
ElementString get value from bar by given key and print them bar.Set("myKey", "string to print") In template use as follows: {{string .
No description provided by the author
Full - preset with all default available elements Example: 'Prefix 20/100 [-->______] 20% 1 p/s ETA 1m Suffix'.
No description provided by the author
No description provided by the author
Wheel created with pipes and slashes.

# Structs

Bar is the main object of bar.
Progress represents the container that renders progress bars.
Reader it's a wrapper for given reader, but with progress handle.
State represents the current state of bar Need for bar elements.
Writer it's a wrapper for given writer, but with progress handle.

# Interfaces

Element is an interface for bar elements.

# Type aliases

ElementFunc type implements Element interface and created for simplify elements.
ProgressBarTemplate that template string.