progress

package
v5.1.15+incompatible Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Copyright 2019 Huawei Technologies Co.,Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2019 Huawei Technologies Co.,Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2019 Huawei Technologies Co.,Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2019 Huawei Technologies Co.,Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2019 Huawei Technologies Co.,Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2019 Huawei Technologies Co.,Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2019 Huawei Technologies Co.,Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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 = `` /* 137-byte string literal not displayed */

	TpsAndSpeed2 = `` /* 134-byte string literal not displayed */
)

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 GetEffectiveStream

func GetEffectiveStream() int64

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
	// 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
	ReadedCount int64
}

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)

type SingleProgressReaderV2

type SingleProgressReaderV2 struct {
	SingleProgressReader
}

func NewSingleProgressReaderV2

func NewSingleProgressReaderV2(reader io.Reader, totalCount int64, enableChecksum bool, barCh SingleBarChan) *SingleProgressReaderV2

func (*SingleProgressReaderV2) Reset

func (spr *SingleProgressReaderV2) Reset() error

Jump to

Keyboard shortcuts

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