Documentation
¶
Index ¶
- Variables
- func CreateDownloadJob(urlS string, pathS string, mbar *BarProxy)
- func CreateDownloadJobOps(urlS string, pathS string, mbar *BarProxy, ops *DownloadJobOptions)
- func CreateJob(name string, f func(*BarProxy))
- func DoBarTransfer(from io.Reader, to io.Writer, max int64, bar *BarProxy)
- func GetCompletionMessage() string
- func GetTaskCount() int
- func GetTaskDownloadSize() int64
- func Init(concurrency int)
- func SetBarStyle(bstyle string)
- func Wait()
- type BarProxy
- type DownloadJobOptions
- type HeadlessBar
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BarStyle = "[=>-]<+" PercentageStyle = style.FgMagenta ETAStyle = style.FgCyan ColoredBar bool )
View Source
var (
MaxHttpRetries = 3
)
Functions ¶
func CreateDownloadJob ¶
func CreateDownloadJobOps ¶
func CreateDownloadJobOps(urlS string, pathS string, mbar *BarProxy, ops *DownloadJobOptions)
func GetCompletionMessage ¶
func GetCompletionMessage() string
func GetTaskCount ¶
func GetTaskCount() int
func GetTaskDownloadSize ¶
func GetTaskDownloadSize() int64
func SetBarStyle ¶
func SetBarStyle(bstyle string)
SetBarStyle sets the mpb style
'1th rune' stands for left boundary rune
'2th rune' stands for fill rune
'3th rune' stands for tip rune
'4th rune' stands for empty rune
'5th rune' stands for right boundary rune
Default style is `[=>-]`
Types ¶
type BarProxy ¶
func (*BarProxy) AddToTotal ¶
type DownloadJobOptions ¶
type HeadlessBar ¶
type HeadlessBar struct {
// contains filtered or unexported fields
}
func CreateHeadlessJob ¶
func CreateHeadlessJob(name string, max int64, bar *BarProxy) *HeadlessBar
func (*HeadlessBar) AddToMax ¶
func (b *HeadlessBar) AddToMax(by int64)
func (*HeadlessBar) Done ¶
func (b *HeadlessBar) Done()
Done really should be called FinishNow to follow my own naming convention but here we are. Done completes the current HeadlessBar regardless of its current progress.
func (*HeadlessBar) Increment ¶
func (b *HeadlessBar) Increment(by int)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.