Codebase list golang-github-vbauerster-mpb / 9cad90f
Some godoc comments Vladimir Bauer 8 years ago
3 changed file(s) with 8 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
7474 }
7575 )
7676
77 func newBar(ID int, total int64, wg *sync.WaitGroup, cancel <-chan struct{}, options ...BarOption) *Bar {
77 func newBar(id int, total int64, wg *sync.WaitGroup, cancel <-chan struct{}, options ...BarOption) *Bar {
7878 if total <= 0 {
7979 total = time.Now().Unix()
8080 }
8181
8282 s := &bState{
83 id: ID,
83 id: id,
8484 total: total,
8585 etaAlpha: etaAlpha,
8686 dropRatio: 10,
178178 }
179179 }
180180
181 // NumOfAppenders returns current number of append decorators
181182 func (b *Bar) NumOfAppenders() int {
182183 result := make(chan int, 1)
183184 select {
188189 }
189190 }
190191
192 // NumOfPrependers returns current number of prepend decorators
191193 func (b *Bar) NumOfPrependers() int {
192194 result := make(chan int, 1)
193195 select {
209211 }
210212 }
211213
214 // Current returns bar's current number, in other words sum of all increments.
212215 func (b *Bar) Current() int64 {
213216 result := make(chan int64, 1)
214217 select {
219222 }
220223 }
221224
225 // Total returns bar's total number.
222226 func (b *Bar) Total() int64 {
223227 result := make(chan int64, 1)
224228 select {
3333 }
3434 }
3535
36 // BarTirm trims both left and right spaces of the bar
36 // BarTrim trims both left and right spaces of the bar
3737 func BarTrim() BarOption {
3838 return func(s *bState) {
3939 s.trimLeftSpace = true
33
44 import "context"
55
6 // WithContext provided context will be used for cancellation purposes
67 func WithContext(ctx context.Context) ProgressOption {
78 return func(s *pState) {
89 if ctx != nil {