pbar

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

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PBar

type PBar struct {
	// Completed actions.
	Done int

	// Total actions.
	Total int

	// Size multiplier (0.0 - 1.0).
	Size float64

	// Verbosity.
	Verbose int
}

PBar is a progress bar instance.

func NewPBar

func NewPBar() *PBar

NewPBar creates a new progress bar instance with default values.

func (*PBar) Back

func (pb *PBar) Back()

Back decrements Done by 1 and logs the progress bar.

func (*PBar) BackMsg

func (pb *PBar) BackMsg(msg string, msgLong string)

BackMsg decrements Done by 1 and logs the progress bar with message.

func (*PBar) Log

func (pb *PBar) Log()

Log progress bar.

func (*PBar) LogMsg

func (pb *PBar) LogMsg(msg string, msgLong string)

LogMsg logs progress bar with message capabilities.

`msg` and `msgLong` may be ignored based on `pb.Verbose`.

Verbosities:

<= 0: Plain progress bar.
== 1: `msg` is appended to the progress bar.
>= 2: Progress bar is discarded, `msgLong` is forwarded to `fmt.Print`.

func (*PBar) Next

func (pb *PBar) Next(msg string, format string, v ...any)

Next increments Done by 1 and logs the progress bar.

func (*PBar) NextMsg

func (pb *PBar) NextMsg(msg string, msgLong string)

NextMsg increments Done by 1 and logs the progress bar with message.

Jump to

Keyboard shortcuts

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