diff --git a/bar.go b/bar.go index c05ec42..f18ef96 100644 --- a/bar.go +++ b/bar.go @@ -15,7 +15,7 @@ "github.com/vbauerster/mpb/v6/decor" ) -// Bar represents a progress Bar. +// Bar represents a progress bar. type Bar struct { priority int // used by heap index int // used by heap @@ -44,6 +44,8 @@ type extenderFunc func(in io.Reader, reqWidth int, st decor.Statistics) (out io.Reader, lines int) +// bState is actual bar state. It gets passed to *Bar.serve(...) monitor +// goroutine. type bState struct { id int priority int diff --git a/progress.go b/progress.go index c53430d..5a3f962 100644 --- a/progress.go +++ b/progress.go @@ -22,7 +22,8 @@ prr = 120 * time.Millisecond ) -// Progress represents the container that renders Progress bars +// Progress represents a container that renders one or more progress +// bars. type Progress struct { ctx context.Context uwg *sync.WaitGroup @@ -35,6 +36,8 @@ dlogger *log.Logger } +// pState holds bars in its priorityQueue. It gets passed to +// *Progress.serve(...) monitor goroutine. type pState struct { bHeap priorityQueue heapUpdated bool @@ -172,7 +175,7 @@ p.setBarPriority(b, priority) } -// BarCount returns bars count +// BarCount returns bars count. func (p *Progress) BarCount() int { result := make(chan int, 1) select {