BaseRefiller
Vladimir Bauer
6 years ago
| 16 | 16 | // Filler interface. |
| 17 | 17 | // Bar renders by calling Filler's Fill method. You can literally have |
| 18 | 18 | // any bar kind, by implementing this interface and passing it to the |
| 19 | // mpb.Add function. | |
| 19 | // *Progress.Add method. | |
| 20 | 20 | type Filler interface { |
| 21 | 21 | Fill(w io.Writer, width int, stat *decor.Statistics) |
| 22 | 22 | } |
| 26 | 26 | |
| 27 | 27 | func (f FillerFunc) Fill(w io.Writer, width int, stat *decor.Statistics) { |
| 28 | 28 | f(w, width, stat) |
| 29 | } | |
| 30 | ||
| 31 | // BaseFiller interface. | |
| 32 | // If you ever need to implement a custom Filler based on mpb.NewBarFiller, | |
| 33 | // then you may need to implement this one as well, in order to retain | |
| 34 | // functionality of some `BarOption`s and method like *Bar.SetRefill. | |
| 35 | type BaseFiller interface { | |
| 36 | BaseFiller() Filler | |
| 29 | 37 | } |
| 30 | 38 | |
| 31 | 39 | // Bar represents a progress Bar. |