progress

package
v0.12.10 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProgressManager

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

func NewProgressBar

func NewProgressBar(total int, description string) *ProgressManager

NewProgressBar creates a progress bar with a fixed width and padded/truncated description

func (*ProgressManager) Bprintf

func (p *ProgressManager) Bprintf(format string, a ...interface{}) (int, error)

Bprintf prints a formatted message above the bar.

func (*ProgressManager) Bprintln

func (p *ProgressManager) Bprintln(a ...interface{}) (int, error)

Bprintln prints a message on its own clean line above the bar, then redraws the bar. We do not delegate to progressbar.Bprintln because its clear is a no-op until the bar has measured its width, which races the throttled render and leaves the message glued to the end of the bar line.

func (*ProgressManager) ClearLine

func (p *ProgressManager) ClearLine()

ClearLine clears the current console line.

func (*ProgressManager) Finish

func (p *ProgressManager) Finish()

Finish completes the bar and prints a newline.

func (*ProgressManager) Increment

func (p *ProgressManager) Increment()

Increment increases the current progress by one.

func (*ProgressManager) RenderBlank

func (p *ProgressManager) RenderBlank()

RenderBlank renders an empty bar state.

func (*ProgressManager) SetMessage

func (p *ProgressManager) SetMessage(description string)

SetMessage updates the bar's description, padded/truncated to fixed width.

func (*ProgressManager) SetTotal

func (p *ProgressManager) SetTotal(total int)

SetTotal updates the maximum count of the progress bar.

func (*ProgressManager) Write

func (p *ProgressManager) Write(data []byte) (int, error)

Write adds the length of data to the bar.

Jump to

Keyboard shortcuts

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