Some godoc comments
Vladimir Bauer
8 years ago
| 74 | 74 | } |
| 75 | 75 | ) |
| 76 | 76 | |
| 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 { | |
| 78 | 78 | if total <= 0 { |
| 79 | 79 | total = time.Now().Unix() |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | s := &bState{ |
| 83 | id: ID, | |
| 83 | id: id, | |
| 84 | 84 | total: total, |
| 85 | 85 | etaAlpha: etaAlpha, |
| 86 | 86 | dropRatio: 10, |
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | // NumOfAppenders returns current number of append decorators | |
| 181 | 182 | func (b *Bar) NumOfAppenders() int { |
| 182 | 183 | result := make(chan int, 1) |
| 183 | 184 | select { |
| 188 | 189 | } |
| 189 | 190 | } |
| 190 | 191 | |
| 192 | // NumOfPrependers returns current number of prepend decorators | |
| 191 | 193 | func (b *Bar) NumOfPrependers() int { |
| 192 | 194 | result := make(chan int, 1) |
| 193 | 195 | select { |
| 209 | 211 | } |
| 210 | 212 | } |
| 211 | 213 | |
| 214 | // Current returns bar's current number, in other words sum of all increments. | |
| 212 | 215 | func (b *Bar) Current() int64 { |
| 213 | 216 | result := make(chan int64, 1) |
| 214 | 217 | select { |
| 219 | 222 | } |
| 220 | 223 | } |
| 221 | 224 | |
| 225 | // Total returns bar's total number. | |
| 222 | 226 | func (b *Bar) Total() int64 { |
| 223 | 227 | result := make(chan int64, 1) |
| 224 | 228 | select { |