forked from jedib0t/go-pretty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwriter.go
41 lines (38 loc) · 930 Bytes
/
writer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package progress
import (
"io"
"time"
)
// Writer declares the interfaces that can be used to setup and render a
// Progress tracker with one or more trackers.
type Writer interface {
AppendTracker(tracker *Tracker)
AppendTrackers(trackers []*Tracker)
IsRenderInProgress() bool
Length() int
LengthActive() int
LengthDone() int
LengthInQueue() int
SetAutoStop(autoStop bool)
SetMessageWidth(width int)
SetNumTrackersExpected(numTrackers int)
SetOutputWriter(output io.Writer)
SetSortBy(sortBy SortBy)
SetStyle(style Style)
SetTrackerLength(length int)
SetTrackerPosition(position Position)
ShowETA(show bool)
ShowOverallTracker(show bool)
ShowPercentage(show bool)
ShowTime(show bool)
ShowTracker(show bool)
ShowValue(show bool)
SetUpdateFrequency(frequency time.Duration)
Stop()
Style() *Style
Render()
}
// NewWriter initializes and returns a Writer.
func NewWriter() Writer {
return &Progress{}
}