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" )
Click to show internal directories.
Click to hide internal directories.