progressBar

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

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

Go to latest
Published: Oct 9, 2024 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 format and v are forwarded to fmt.Printf.
	Verbose = 0
)

Functions

func Back

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

Same as Log but will decrement 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 will increment 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 🇻🇳