mirror of
https://github.com/XIU2/CloudflareSpeedTest.git
synced 2026-03-17 04:36:29 +08:00
rebuild download
This commit is contained in:
@@ -2,14 +2,6 @@ package utils
|
||||
|
||||
import "github.com/cheggaaa/pb/v3"
|
||||
|
||||
type ProgressEvent int
|
||||
|
||||
const (
|
||||
NoAvailableIPFound ProgressEvent = iota
|
||||
AvailableIPFound
|
||||
NormalPing
|
||||
)
|
||||
|
||||
type Bar struct {
|
||||
pb *pb.ProgressBar
|
||||
}
|
||||
@@ -24,17 +16,4 @@ func (b *Bar) Grow(num int) {
|
||||
|
||||
func (b *Bar) Done() {
|
||||
b.pb.Finish()
|
||||
}
|
||||
|
||||
func handleProgressGenerator(pb *pb.ProgressBar) func(e ProgressEvent) {
|
||||
return func(e ProgressEvent) {
|
||||
switch e {
|
||||
case NoAvailableIPFound:
|
||||
// pb.Add(pingTime)
|
||||
case AvailableIPFound:
|
||||
// pb.Add(failTime)
|
||||
case NormalPing:
|
||||
pb.Increment()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user