新增 指定IP段数据(-ip) 参数; 新增 延迟测速时显示可用 IP 数量; 新增 有效状态代码(HTTPing 模式所用) 参数; 优化 HTTPing 延迟测速模式; 优化 匹配指定地区 功能

This commit is contained in:
xiu2
2023-01-31 20:11:13 +08:00
parent f4f1fdcd80
commit a1ae4f8e45
7 changed files with 248 additions and 248 deletions

View File

@@ -6,10 +6,7 @@ import (
"log"
"net"
"os"
"sort"
"strconv"
"strings"
"sync"
"time"
)
@@ -24,7 +21,6 @@ var (
InputMinDelay = minDelay
Output = defaultOutput
PrintNum = 10
ColoAble sync.Map
)
// 是否打印测试结果
@@ -143,16 +139,6 @@ func (s DownloadSpeedSet) Swap(i, j int) {
}
func (s DownloadSpeedSet) Print() {
var colos []string
ColoAble.Range(func(key, value interface{}) bool {
colos = append(colos, key.(string))
return true
})
if len(colos) != 0 {
sort.Strings(colos)
colostrings := strings.Join(colos, ",")
fmt.Println("\n下次可以考虑机场三字码参数" + colostrings + "\n")
}
if NoPrintResult() {
return
}

View File

@@ -11,7 +11,7 @@ type Bar struct {
}
func NewBar(count int, MyStrStart, MyStrEnd string) *Bar {
tmpl := fmt.Sprintf(`{{counters . }}{{ bar . "[" "-" (cycle . "↖" "↗" "↘" "↙" ) "_" "]"}} %s {{string . "MyStr" | green}} %s `, MyStrStart, MyStrEnd)
tmpl := fmt.Sprintf(`{{counters . }} {{ bar . "[" "-" (cycle . "↖" "↗" "↘" "↙" ) "_" "]"}} %s {{string . "MyStr" | green}} %s `, MyStrStart, MyStrEnd)
bar := pb.ProgressBarTemplate(tmpl).Start(count)
return &Bar{pb: bar}
}