progress

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 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 Progress

type Progress struct {
	ID          string
	Type        ProgressType
	Label       string
	Current     int
	Total       int
	Percent     float64
	Cancellable bool
	StartedAt   time.Time
}

Progress captures the current state of a long-running task.

type ProgressManager

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

ProgressManager tracks active progress entries.

func NewProgressManager

func NewProgressManager() *ProgressManager

NewProgressManager creates a new manager.

func (*ProgressManager) Done

func (pm *ProgressManager) Done(id string)

Done removes a progress entry.

func (*ProgressManager) SetOnChange

func (pm *ProgressManager) SetOnChange(fn func([]Progress))

SetOnChange configures the callback for progress updates.

func (*ProgressManager) Start

func (pm *ProgressManager) Start(id, label string, ptype ProgressType, total int)

Start begins tracking a progress entry.

func (*ProgressManager) Update

func (pm *ProgressManager) Update(id string, current int)

Update updates the current value for a progress entry.

type ProgressType

type ProgressType string

ProgressType describes how progress should be presented.

const (
	ProgressIndeterminate ProgressType = "indeterminate"
	ProgressDeterminate   ProgressType = "determinate"
	ProgressSteps         ProgressType = "steps"
)

Jump to

Keyboard shortcuts

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