mirror of
https://github.com/XIU2/CloudflareSpeedTest.git
synced 2026-03-07 23:25:53 +08:00
tcping add progressbar
This commit is contained in:
@@ -11,13 +11,21 @@ const (
|
||||
)
|
||||
|
||||
type Bar struct {
|
||||
*pb.ProgressBar
|
||||
pb *pb.ProgressBar
|
||||
}
|
||||
|
||||
func NewBar(count int) *Bar {
|
||||
return &Bar{pb.Simple.Start(count)}
|
||||
}
|
||||
|
||||
func (b *Bar) Grow(num int) {
|
||||
b.pb.Add(num)
|
||||
}
|
||||
|
||||
func (b *Bar) Done() {
|
||||
b.pb.Finish()
|
||||
}
|
||||
|
||||
func handleProgressGenerator(pb *pb.ProgressBar) func(e ProgressEvent) {
|
||||
return func(e ProgressEvent) {
|
||||
switch e {
|
||||
|
||||
Reference in New Issue
Block a user