From c75a034d25ca87f3d209a8e82c743b8a7e96573b Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 8 Mar 2026 14:15:38 +0800 Subject: internal/progress: Add progress meter --- internal/progress/meter.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 internal/progress/meter.go (limited to 'internal/progress/meter.go') 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 +} -- cgit v1.3.1-10-gc9f91