mbpp

package
v0.0.0-...-3f18df6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2020 License: MIT Imports: 17 Imported by: 11

Documentation

Index

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 CreateDownloadJob(urlS string, pathS string, mbar *BarProxy)

func CreateDownloadJobOps

func CreateDownloadJobOps(urlS string, pathS string, mbar *BarProxy, ops *DownloadJobOptions)

func CreateJob

func CreateJob(name string, f func(*BarProxy))

func DoBarTransfer

func DoBarTransfer(from io.Reader, to io.Writer, max int64, bar *BarProxy)

func GetCompletionMessage

func GetCompletionMessage() string

func GetTaskCount

func GetTaskCount() int

func GetTaskDownloadSize

func GetTaskDownloadSize() int64

func Init

func Init(concurrency int)

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 `[=>-]`

func Wait

func Wait()

Types

type BarProxy

type BarProxy struct {
	T int64
	B *mpb.Bar
	// contains filtered or unexported fields
}

func (*BarProxy) AddToTotal

func (b *BarProxy) AddToTotal(by int64)

func (*BarProxy) FinishNow

func (b *BarProxy) FinishNow()

func (*BarProxy) Increment

func (b *BarProxy) Increment(by int)

func (*BarProxy) Wait

func (b *BarProxy) Wait()

type DownloadJobOptions

type DownloadJobOptions struct {
	Headers map[string]string
}

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL