progress

package
v5.1.4+incompatible Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Standard = `{{bar . }} {{percent . }} {{speed .}} {{rtime . }}`

	Simple = `{{bar .}} {{percent . }} {{counter . }} {{crtime . }}`

	TpsOnly = `{{bar . | tpsBarColor}} {{percent . }} {{tps .}} {{counter . }} {{crtime . }}`

	SpeedOnly = `{{bar . | speedBarColor }} {{percent . }} {{cspeed . | speedColor }} {{counter . "stream"}} {{crtime . "stream"}}`

	TpsAndSpeed = `{{bar . | speedBarColor}} {{percent . }} {{tps .}} {{cspeed . | speedColor}} {{counter . "stream"}} {{crtime . "stream" }}`
)

Variables

This section is empty.

Functions

func AddEffectiveStream

func AddEffectiveStream(value int64) int64

func AddFailedCount

func AddFailedCount(value int64) int64

func AddFinishedCount

func AddFinishedCount(value int64) int64

func AddFinishedStream

func AddFinishedStream(value int64) int64

func AddResumeCount

func AddResumeCount(value int64) int64

func AddSucceedCount

func AddSucceedCount(value int64) int64

func AddSucceedStream

func AddSucceedStream(value int64) int64

func AddTransaction

func AddTransaction(value int64) int64

func AddWarningCount

func AddWarningCount(value int64) int64

func CompareAndSetWarningCount

func CompareAndSetWarningCount(oldValue, newValue int64) bool

func GetFailedCount

func GetFailedCount() int64

func GetFinishedStream

func GetFinishedStream() int64

func GetResumeCount

func GetResumeCount() int64

func GetSucceedCount

func GetSucceedCount() int64

func GetSucceedStream

func GetSucceedStream() int64

func GetTotalStream

func GetTotalStream() int64

func GetTransaction

func GetTransaction() int64

func GetWarningCount

func GetWarningCount() int64

func InitCustomizeElements

func InitCustomizeElements(colorful bool)

func ResetContext

func ResetContext()

func SetTotalCount

func SetTotalCount(value int64)

func SetTotalStream

func SetTotalStream(value int64)

Types

type CheckSumReader

type CheckSumReader struct {
	ReaderWrapper
	EnableChecksum bool
	// contains filtered or unexported fields
}

func (*CheckSumReader) Base64Md5

func (csr *CheckSumReader) Base64Md5() string

func (*CheckSumReader) HexMd5

func (csr *CheckSumReader) HexMd5() string

func (*CheckSumReader) Read

func (csr *CheckSumReader) Read(p []byte) (n int, err error)

type DefaultSingleBarChan

type DefaultSingleBarChan struct {
	TotalCount  int64
	RefreshRate time.Duration
	Template    string
	Width       int
	IsBytes     bool
	// contains filtered or unexported fields
}

func (*DefaultSingleBarChan) Get

func (ch *DefaultSingleBarChan) Get() int64

func (*DefaultSingleBarChan) Send

func (ch *DefaultSingleBarChan) Send(delta int)

func (*DefaultSingleBarChan) Send64

func (ch *DefaultSingleBarChan) Send64(delta int64)

func (*DefaultSingleBarChan) Set

func (ch *DefaultSingleBarChan) Set(current int64)

func (*DefaultSingleBarChan) SetBytes

func (ch *DefaultSingleBarChan) SetBytes(isBytes bool)

func (*DefaultSingleBarChan) SetTemplate

func (ch *DefaultSingleBarChan) SetTemplate(template string)

func (*DefaultSingleBarChan) SetTotalCount

func (ch *DefaultSingleBarChan) SetTotalCount(totalCount int64)

func (*DefaultSingleBarChan) Start

func (ch *DefaultSingleBarChan) Start()

func (*DefaultSingleBarChan) WaitToFinished

func (ch *DefaultSingleBarChan) WaitToFinished()

type NilSingleBarChan

type NilSingleBarChan struct{}

func (*NilSingleBarChan) Send

func (ch *NilSingleBarChan) Send(delta int)

func (*NilSingleBarChan) Send64

func (ch *NilSingleBarChan) Send64(delta int64)

func (*NilSingleBarChan) SetBytes

func (ch *NilSingleBarChan) SetBytes(isBytes bool)

func (*NilSingleBarChan) SetTemplate

func (ch *NilSingleBarChan) SetTemplate(template string)

func (*NilSingleBarChan) SetTotalCount

func (ch *NilSingleBarChan) SetTotalCount(totalCount int64)

func (*NilSingleBarChan) Start

func (ch *NilSingleBarChan) Start()

func (*NilSingleBarChan) WaitToFinished

func (ch *NilSingleBarChan) WaitToFinished()

type ReaderWrapper

type ReaderWrapper struct {
	Reader     io.Reader
	TotalCount int64
	// contains filtered or unexported fields
}

func (*ReaderWrapper) Read

func (rw *ReaderWrapper) Read(p []byte) (n int, err error)

type SingleBarChan

type SingleBarChan interface {
	Start()
	SetTotalCount(count int64)
	Send(delta int)
	Send64(delta int64)
	WaitToFinished()
	SetBytes(isBytes bool)
	SetTemplate(template string)
}

func NewNilSingleBarChan

func NewNilSingleBarChan() SingleBarChan

func NewSingleBarChan

func NewSingleBarChan() SingleBarChan

type SingleProgressReader

type SingleProgressReader struct {
	CheckSumReader
	BarCh SingleBarChan
}

func NewSingleProgressReader

func NewSingleProgressReader(reader io.Reader, totalCount int64, enableChecksum bool, barCh SingleBarChan) *SingleProgressReader

func (*SingleProgressReader) Read

func (spr *SingleProgressReader) Read(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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