Codebase list golang-github-vbauerster-mpb / 3c5b9a4
DefaultSpinnerStyle -> SpinnerDefaultStyle Vladimir Bauer 5 years ago
2 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
1818 SpinnerOnRight
1919 )
2020
21 // DefaultSpinnerStyle is a slice of strings, which makes a spinner.
22 var DefaultSpinnerStyle = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
21 // SpinnerDefaultStyle is a style for rendering a spinner.
22 var SpinnerDefaultStyle = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
2323
2424 type spinnerFiller struct {
2525 frames []string
3232 // applied. To be used with `*Progress.Add(...) *Bar` method.
3333 func NewSpinnerFiller(style []string, alignment SpinnerAlignment) BarFiller {
3434 if len(style) == 0 {
35 style = DefaultSpinnerStyle
35 style = SpinnerDefaultStyle
3636 }
3737 filler := &spinnerFiller{
3838 frames: style,
101101
102102 // AddSpinner creates a new spinner bar and adds it to the rendering queue.
103103 func (p *Progress) AddSpinner(total int64, alignment SpinnerAlignment, options ...BarOption) *Bar {
104 return p.Add(total, NewSpinnerFiller(DefaultSpinnerStyle, alignment), options...)
104 return p.Add(total, NewSpinnerFiller(SpinnerDefaultStyle, alignment), options...)
105105 }
106106
107107 // Add creates a bar which renders itself by provided filler.