progress

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package progress provides pre-configured progress bar utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTracker

func NewTracker(message string, total int64) *progress.Tracker

NewTracker creates a new tracker with the given message and total.

Types

type Tracker added in v1.0.1

type Tracker = progress.Tracker

Tracker is an alias for the underlying progress.Tracker type.

type Writer

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

Writer is a wrapper around progress.Writer with pre-configured settings.

func NewWriter

func NewWriter(numTrackers int, quiet bool) *Writer

NewWriter creates a new progress writer with pre-configured settings and colors.

func (*Writer) AppendTracker

func (w *Writer) AppendTracker(tracker *progress.Tracker)

AppendTracker adds a tracker to the progress writer.

func (*Writer) Log

func (w *Writer) Log(msg string, args ...any)

Log prints a message above the progress bars.

func (*Writer) SetOutputWriter added in v1.1.0

func (w *Writer) SetOutputWriter(out io.Writer)

SetOutputWriter redirects rendered output to out.

func (*Writer) Start

func (w *Writer) Start()

Start begins rendering the progress bars in a goroutine.

func (*Writer) Stop

func (w *Writer) Stop()

Stop stops the progress writer without clearing.

func (*Writer) StopAndClear

func (w *Writer) StopAndClear()

StopAndClear stops the progress writer and erases the rendered trackers from the terminal. Line count is taken from the NewWriter argument so callers never have to keep that number in sync by hand.

func (*Writer) WaitForRenderDone added in v1.1.0

func (w *Writer) WaitForRenderDone()

WaitForRenderDone spins until the render goroutine finishes its final pass.

Jump to

Keyboard shortcuts

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