edit comments
Vladimir Bauer
6 years ago
| 17 | 17 |
rRefill
|
| 18 | 18 |
)
|
| 19 | 19 |
|
| 20 | |
// DefaultBarStyle is applied when bar constructed with *Progress.AddBar method.
|
|
20 |
// DefaultBarStyle is a string containing 7 runes.
|
|
21 |
// Each rune is a building block of a progress bar.
|
| 21 | 22 |
//
|
| 22 | 23 |
// '1st rune' stands for left boundary rune
|
| 23 | 24 |
//
|
|
| 43 | 44 |
flush func(w io.Writer, bb [][]byte)
|
| 44 | 45 |
}
|
| 45 | 46 |
|
| 46 | |
// NewBarFiller constucts mpb.Filler, to be used with *Progress.Add method.
|
|
47 |
// NewBarFiller constucts mpb.BarFiller, to be used with *Progress.Add(...) *Bar method.
|
| 47 | 48 |
func NewBarFiller(style string, reverse bool) BarFiller {
|
| 48 | 49 |
if style == "" {
|
| 49 | 50 |
style = DefaultBarStyle
|
| 17 | 17 |
SpinnerOnRight
|
| 18 | 18 |
)
|
| 19 | 19 |
|
| 20 | |
// DefaultSpinnerStyle is applied when bar constructed with *Progress.AddSpinner method.
|
|
20 |
// DefaultSpinnerStyle is a slice of strings, which makes a spinner.
|
| 21 | 21 |
var DefaultSpinnerStyle = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
|
| 22 | 22 |
|
| 23 | 23 |
type spinnerFiller struct {
|
|
| 26 | 26 |
alignment SpinnerAlignment
|
| 27 | 27 |
}
|
| 28 | 28 |
|
| 29 | |
// NewSpinnerFiller constucts mpb.Filler, to be used with *Progress.Add method.
|
|
29 |
// NewSpinnerFiller constucts mpb.BarFiller, to be used with *Progress.Add(...) *Bar method.
|
| 30 | 30 |
func NewSpinnerFiller(style []string, alignment SpinnerAlignment) BarFiller {
|
| 31 | 31 |
if len(style) == 0 {
|
| 32 | 32 |
style = DefaultSpinnerStyle
|