Files
ecs/speedtest/sp.go
spiritysdx afec01e688 update
2024-06-29 18:08:26 +08:00

58 lines
1.5 KiB
Go

package speedtest
import (
"github.com/oneclickvirt/speedtest/model"
"github.com/oneclickvirt/speedtest/sp"
"strings"
)
func ShowHead(language string) {
sp.ShowHead(language)
}
func NearbySP() {
sp.NearbySpeedTest()
}
func CustomSP(platform, operator string, num int) {
var url, parseType string
if strings.ToLower(platform) == "cn" {
if strings.ToLower(operator) == "cmcc" {
url = model.CnCMCC
} else if strings.ToLower(operator) == "cu" {
url = model.CnCU
} else if strings.ToLower(operator) == "ct" {
url = model.CnCT
} else if strings.ToLower(operator) == "hk" {
url = model.CnHK
} else if strings.ToLower(operator) == "tw" {
url = model.CnTW
} else if strings.ToLower(operator) == "jp" {
url = model.CnJP
} else if strings.ToLower(operator) == "sg" {
url = model.CnSG
}
parseType = "url"
} else if strings.ToLower(platform) == "net" {
if strings.ToLower(operator) == "cmcc" {
url = model.NetCMCC
} else if strings.ToLower(operator) == "cu" {
url = model.NetCU
} else if strings.ToLower(operator) == "ct" {
url = model.NetCT
} else if strings.ToLower(operator) == "hk" {
url = model.NetHK
} else if strings.ToLower(operator) == "tw" {
url = model.NetTW
} else if strings.ToLower(operator) == "jp" {
url = model.NetJP
} else if strings.ToLower(operator) == "sg" {
url = model.NetSG
} else if strings.ToLower(operator) == "global" {
url = model.NetGlobal
}
parseType = "id"
}
sp.CustomSpeedTest(url, parseType, num)
}