pbar

package module
v0.0.0-...-b067be5 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Done actions to caculate the % completion from.
	// Can be set manually or progressivaly with Next and Back.
	ActionsDone = 0

	// Total actions to caculate the % completion from.
	// Should be set manually.
	ActionsTotal = 0

	// Verbosity 1: extra info is added and msg is appended to the progress bar in Log.
	// The progress bar will be dynamicly size, progress bar and msg will be cut off respecting the terminal width.
	//
	// Verbosity 2 or larger progress bar will act like fmt.Printf.
	Verbose = 0
)

Functions

func Back

func Back(msg string, format string, v ...any)

Same as Log but decrements ActionsDone before loging if the verbosity is lower then 2

func Log

func Log(msg string, format string, v ...any)

Prints a progress bar respecting ActionsDone and ActionsTotal to define the progress.

By default msg, format and v are ignored. The progress bar will be dynamicly size and will be cut off if nessisairy respecting the terminal width.

func Next

func Next(msg string, format string, v ...any)

Same as Log but increments ActionsDone before loging if the verbosity is lower then 2

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳