godoc upd
Vladimir Bauer
6 years ago
| 17 | 17 |
// Filler interface.
|
| 18 | 18 |
// Bar renders by calling Filler's Fill method. You can literally have
|
| 19 | 19 |
// any bar kind, by implementing this interface and passing it to the
|
| 20 | |
// Add method.
|
|
20 |
// mpb.Add function.
|
| 21 | 21 |
type Filler interface {
|
| 22 | 22 |
Fill(w io.Writer, width int, stat *decor.Statistics)
|
| 23 | 23 |
}
|
| 52 | 52 |
}
|
| 53 | 53 |
}
|
| 54 | 54 |
|
| 55 | |
// BarRemoveOnComplete removes whole bar line on complete event. Any
|
| 56 | |
// decorators attached to the bar, having OnComplete action will not
|
| 57 | |
// have a chance to run its OnComplete action, because of this option.
|
|
55 |
// BarRemoveOnComplete removes bar filler and decorators if any, on
|
|
56 |
// complete event.
|
| 58 | 57 |
func BarRemoveOnComplete() BarOption {
|
| 59 | 58 |
return func(s *bState) {
|
| 60 | 59 |
s.dropOnComplete = true
|
|
| 77 | 76 |
}
|
| 78 | 77 |
}
|
| 79 | 78 |
|
| 80 | |
// BarClearOnComplete clears bar part of bar line on complete event.
|
|
79 |
// BarClearOnComplete clears bar filler only, on complete event.
|
| 81 | 80 |
func BarClearOnComplete() BarOption {
|
| 82 | 81 |
return func(s *bState) {
|
| 83 | 82 |
s.filler = makeClearOnCompleteFiller(s.filler)
|