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
- func AddEffectiveStream(value int64) int64
- func AddFailedCount(value int64) int64
- func AddFinishedCount(value int64) int64
- func AddFinishedStream(value int64) int64
- func AddResumeCount(value int64) int64
- func AddSucceedCount(value int64) int64
- func AddSucceedStream(value int64) int64
- func AddTransaction(value int64) int64
- func AddWarningCount(value int64) int64
- func CompareAndSetWarningCount(oldValue, newValue int64) bool
- func GetEffectiveStream() int64
- func GetFailedCount() int64
- func GetFinishedStream() int64
- func GetResumeCount() int64
- func GetSucceedCount() int64
- func GetSucceedStream() int64
- func GetTotalStream() int64
- func GetTransaction() int64
- func GetWarningCount() int64
- func InitCustomizeElements(colorful bool)
- func ResetContext()
- func SetTotalCount(value int64)
- func SetTotalStream(value int64)
- type CheckSumReader
- type DefaultSingleBarChan
- func (ch *DefaultSingleBarChan) Get() int64
- func (ch *DefaultSingleBarChan) Send(delta int)
- func (ch *DefaultSingleBarChan) Send64(delta int64)
- func (ch *DefaultSingleBarChan) Set(current int64)
- func (ch *DefaultSingleBarChan) SetBytes(isBytes bool)
- func (ch *DefaultSingleBarChan) SetTemplate(template string)
- func (ch *DefaultSingleBarChan) SetTotalCount(totalCount int64)
- func (ch *DefaultSingleBarChan) Start()
- func (ch *DefaultSingleBarChan) WaitToFinished()
- type NilSingleBarChan
- func (ch *NilSingleBarChan) Send(delta int)
- func (ch *NilSingleBarChan) Send64(delta int64)
- func (ch *NilSingleBarChan) SetBytes(isBytes bool)
- func (ch *NilSingleBarChan) SetTemplate(template string)
- func (ch *NilSingleBarChan) SetTotalCount(totalCount int64)
- func (ch *NilSingleBarChan) Start()
- func (ch *NilSingleBarChan) WaitToFinished()
- type ReaderWrapper
- type SingleBarChan
- type SingleProgressReader
- type SingleProgressReaderV2
Constants ¶
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 AddFailedCount ¶
func AddFinishedCount ¶
func AddFinishedStream ¶
func AddResumeCount ¶
func AddSucceedCount ¶
func AddSucceedStream ¶
func AddTransaction ¶
func AddWarningCount ¶
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
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 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
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