Documentation ¶
Index ¶
- func AnsiScrollUp(rows int, out io.Writer)
- func CalcDur() func(int, int, time.Time, bool) string
- func CalcPct(curr, total int, start time.Time, stopped bool) string
- func CalcSteps(curr, total int, start time.Time, stopped bool) string
- type Bar
- func (b *Bar) GetColors() BarColors
- func (b *Bar) Increment()
- func (b *Bar) SetColors(colors *BarColors)
- func (b *Bar) SetMessage(msg string)
- func (b *Bar) SetPostBar(f func(int, int, time.Time, bool) string)
- func (b *Bar) SetPreBar(f func(int, int, time.Time, bool) string)
- func (b *Bar) Stop(msg, extMsg string)
- func (b *Bar) String() string
- func (b *Bar) Update(curr int)
- type BarColors
- type Param
- type Progress
- func (p *Progress) Bar(key string) *Bar
- func (p *Progress) NewBar(key string, total int) *Bar
- func (p *Progress) SetColors(colors *BarColors)
- func (p *Progress) SetPostBar(f func(int, int, time.Time, bool) string)
- func (p *Progress) SetPreBar(f func(int, int, time.Time, bool) string)
- func (p *Progress) Start()
- func (p *Progress) Stop(msg, extMsg string)
- func (p *Progress) Wait()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnsiScrollUp ¶
AnsiScrollUp uses ANSI escape codes to do the scroll up action
Types ¶
type Bar ¶
type Bar struct {
// contains filtered or unexported fields
}
Bar represents a single progress bar
func (*Bar) Increment ¶
func (b *Bar) Increment()
Increment updates the current status of the bar by 1
func (*Bar) SetMessage ¶
SetMessage sets the displayed current message
func (*Bar) SetPostBar ¶
SetPostBar sets the postbar function decorator
type BarColors ¶
type BarColors struct {
Post, Key, KeyDiv, Msg, PreBar, LBracket, Empty, Full, Curr, RBracket,
PostBar, StopMsg, StopExtMsg func(string, ...interface{}) string
}
BarColors represents a structure holding all bar drawing colors
func DefaultColors ¶
func DefaultColors() *BarColors
DefaultColors returns a set of default colors for rendering the bar
type Param ¶
type Param struct { Interval time.Duration Out io.Writer ScrollUp func(int, io.Writer) InlineExtMsg bool PrePad, KeyWidth, MsgWidth, PreBarWidth, BarWidth, PostBarWidth int Post string KeyDiv, LBracket, RBracket, Empty, Full, Curr rune }
Param represents the parameters for a Progress
func DefaultParam ¶
func DefaultParam() *Param
DefaultParam builds a Param struct with default values
type Progress ¶
type Progress struct {
// contains filtered or unexported fields
}
Progress represents a collection of progress bars
func NewWithParam ¶
NewWithParam creates a new progress bar collection with specified params
func (*Progress) Bar ¶
Bar returns the bar stored the given key. The value is nil if it can't be found
func (*Progress) NewBar ¶
NewBar creates a new progress bar and adds it to the progress bar collection
func (*Progress) SetColors ¶
SetColors sets the colors used to render all the bars part of this progress
func (*Progress) SetPostBar ¶
SetPostBar sets the postbar function decorator