aboutsummaryrefslogtreecommitdiff
path: root/internal/progress/meter.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/progress/meter.go')
-rw-r--r--internal/progress/meter.go30
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
+}