Documentation
¶
Overview ¶
Package progress provides a way to display progress bars in the terminal.
Index ¶
- Variables
- func Listen()
- func Start()
- func Stop()
- type Bar
- func (b *Bar) Bytes() []byte
- func (b *Bar) CompletedPercent() float64
- func (b *Bar) CompletedPercentString() string
- func (b *Bar) Current() int
- func (p *Bar) Done() error
- func (b *Bar) Incr() bool
- func (p *Bar) Increment() error
- func (b *Bar) Set(current int) error
- func (b *Bar) String() string
- func (b *Bar) TimeElapsed() time.Duration
- type Progress
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Head byte = '>' Filler byte = '=' Empty byte = '-' Delimiter byte = '|' )
Functions ¶
Types ¶
type Bar ¶
type Bar struct {
TimeStarted time.Time
MarginLeft int
Width int
MarginRight int
Bar byte
Empty byte
Delimiter byte
Head byte
// contains filtered or unexported fields
}
func (*Bar) CompletedPercent ¶
CompletedPercent return the percent completed
func (*Bar) CompletedPercentString ¶
CompletedPercentString returns the formatted string representation of the completed percent
func (*Bar) TimeElapsed ¶
TimeElapsed returns the time elapsed
type Progress ¶
type Progress struct {
Out io.Writer
Bars []*Bar
Width int
RefreshRate time.Duration
// contains filtered or unexported fields
}
func (*Progress) Bypass ¶
Bypass returns a writer which allows non-buffered data to be written to the underlying output
func (*Progress) Listen ¶
func (p *Progress) Listen()
Listen listens for updates and renders the progress bars
func (*Progress) SetRefreshRate ¶
SetRefreshRate sets the refresh rate for the progress bar
Click to show internal directories.
Click to hide internal directories.