新增 HTTPing 延迟测速模式(beta); 新增 IP 机场三字码 colo 筛选功能(beta) (#282)

这两个功能目前仅为测试版,后续会大幅改动,以最终成品为准~
This commit is contained in:
kaka
2023-01-31 12:48:28 +08:00
committed by GitHub
parent 562789aa15
commit f4f1fdcd80
7 changed files with 213 additions and 19 deletions

View File

@@ -6,7 +6,10 @@ import (
"log"
"net"
"os"
"sort"
"strconv"
"strings"
"sync"
"time"
)
@@ -21,6 +24,7 @@ var (
InputMinDelay = minDelay
Output = defaultOutput
PrintNum = 10
ColoAble sync.Map
)
// 是否打印测试结果
@@ -139,6 +143,16 @@ 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
}