progress

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(opts Options)

Initialize sets up the global progress manager

Types

type Manager

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

Manager manages progress indicators for the application

func Default

func Default() *Manager

Default returns the default progress manager

func New

func New(opts Options) *Manager

New creates a new progress manager

func (*Manager) FinishProgress

func (m *Manager) FinishProgress(id string, success bool, message string)

FinishProgress completes a progress bar

func (*Manager) GetMemoryStats

func (m *Manager) GetMemoryStats() (int, int)

GetMemoryStats returns memory usage statistics for monitoring

func (*Manager) StartProgress

func (m *Manager) StartProgress(id, description string, total int)

StartProgress starts a determinate progress bar

func (*Manager) StartSpinner

func (m *Manager) StartSpinner(id, description string)

StartSpinner starts an indeterminate progress spinner

func (*Manager) StopAll

func (m *Manager) StopAll()

StopAll stops all active progress indicators

func (*Manager) StopSpinner

func (m *Manager) StopSpinner(id string, success bool, message string)

StopSpinner stops a spinner and optionally shows a completion message

func (*Manager) UpdateDescription

func (m *Manager) UpdateDescription(id, description string)

UpdateDescription updates the description of a progress bar or spinner

func (*Manager) UpdateProgress

func (m *Manager) UpdateProgress(id string, increment int)

UpdateProgress updates a progress bar

func (*Manager) WithProgress

func (m *Manager) WithProgress(description string, total int, fn func(update func(int)) error) error

WithProgress executes a function with a progress bar

func (*Manager) WithSpinner

func (m *Manager) WithSpinner(description string, fn func() error) error

WithSpinner executes a function with a spinner

type Options

type Options struct {
	Enabled bool
	Verbose bool
	DryRun  bool
	NoColor bool
	Output  io.Writer
}

Options configures the progress manager

Jump to

Keyboard shortcuts

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