rebuild download

This commit is contained in:
mazhuang
2021-11-10 17:12:12 +08:00
parent 4d64abb94d
commit f1a9b5c966
8 changed files with 287 additions and 390 deletions

View File

@@ -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()
}
}
}
}