progress

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 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 ProgressMessage

type ProgressMessage struct {
	Type       string  `json:"type"`
	Phase      string  `json:"phase"`
	Message    string  `json:"message"`
	Elapsed    float64 `json:"elapsed"`
	Progress   float64 `json:"progress,omitempty"`   // 0-100 percentage
	Current    int     `json:"current,omitempty"`    // Current item count
	Total      int     `json:"total,omitempty"`      // Total item count
	ETA        float64 `json:"eta,omitempty"`        // Estimated seconds remaining
	Throughput float64 `json:"throughput,omitempty"` // Items per second
}

ProgressMessage represents a progress update in JSON format

type Reporter

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

Reporter provides progress reporting functionality for long-running operations

func NewJSONReporter

func NewJSONReporter(enabled bool) *Reporter

NewJSONReporter creates a new progress reporter with JSON output

func NewReporter

func NewReporter(enabled bool) *Reporter

NewReporter creates a new progress reporter

func (*Reporter) Complete

func (p *Reporter) Complete(msg string)

Complete marks the operation as complete with a final message

func (*Reporter) SetTotal added in v0.9.2

func (p *Reporter) SetTotal(total int)

SetTotal sets the total number of items to process (for percentage/ETA calculation)

func (*Reporter) Start

func (p *Reporter) Start(msg string)

Start begins a progress reporting session with an initial message

func (*Reporter) Update

func (p *Reporter) Update(msg string)

Update reports progress with a message and elapsed time

func (*Reporter) UpdateProgress added in v0.9.2

func (p *Reporter) UpdateProgress(msg string)

UpdateProgress reports progress with a specific count (increments current)

func (*Reporter) UpdateWithCount added in v0.9.2

func (p *Reporter) UpdateWithCount(current int, msg string)

UpdateWithCount reports progress with an explicit current count

Jump to

Keyboard shortcuts

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