Codebase list golang-github-vbauerster-mpb / 7904ea7
godocs Vladimir Bauer 5 years ago
2 changed file(s) with 8 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
1414 "github.com/vbauerster/mpb/v6/decor"
1515 )
1616
17 // Bar represents a progress Bar.
17 // Bar represents a progress bar.
1818 type Bar struct {
1919 priority int // used by heap
2020 index int // used by heap
4343
4444 type extenderFunc func(in io.Reader, reqWidth int, st decor.Statistics) (out io.Reader, lines int)
4545
46 // bState is actual bar state. It gets passed to *Bar.serve(...) monitor
47 // goroutine.
4648 type bState struct {
4749 id int
4850 priority int
2121 prr = 120 * time.Millisecond
2222 )
2323
24 // Progress represents the container that renders Progress bars
24 // Progress represents a container that renders one or more progress
25 // bars.
2526 type Progress struct {
2627 ctx context.Context
2728 uwg *sync.WaitGroup
3435 dlogger *log.Logger
3536 }
3637
38 // pState holds bars in its priorityQueue. It gets passed to
39 // *Progress.serve(...) monitor goroutine.
3740 type pState struct {
3841 bHeap priorityQueue
3942 heapUpdated bool
171174 p.setBarPriority(b, priority)
172175 }
173176
174 // BarCount returns bars count
177 // BarCount returns bars count.
175178 func (p *Progress) BarCount() int {
176179 result := make(chan int, 1)
177180 select {