diff options
| author | 2026-03-08 14:15:38 +0800 | |
|---|---|---|
| committer | 2026-03-08 14:15:38 +0800 | |
| commit | c75a034d25ca87f3d209a8e82c743b8a7e96573b (patch) | |
| tree | d8cd5befb9d812ab622dcce094c9d30797d6d861 /internal/progress/meter.go | |
| parent | *: BestEffortFprintf as linter wants (diff) | |
| signature | No signature | |
internal/progress: Add progress meter
Diffstat (limited to 'internal/progress/meter.go')
| -rw-r--r-- | internal/progress/meter.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/internal/progress/meter.go b/internal/progress/meter.go new file mode 100644 index 00000000..3c0079dd --- /dev/null +++ b/internal/progress/meter.go @@ -0,0 +1,30 @@ +package progress + +import ( + "io" + "time" +) + +// Meter renders one in-place progress line. +type Meter struct { + writer io.Writer + flush func() error + + title string + total uint64 + delay time.Duration + sparse bool + throughput bool + + startedAt time.Time + nextUpdateAt time.Time + nextThroughput time.Time + + lastDone uint64 + lastBytes uint64 + lastPercent int + lastCounterW int + sawValue bool + + throughputSuffix string +} |
