mirror of
http://bgp.hk.skcks.cn:10088/github.com/oneclickvirt/ecs
synced 2026-04-20 21:01:12 +08:00
36 lines
747 B
Go
36 lines
747 B
Go
package tests
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/oneclickvirt/UnlockTests/executor"
|
|
"github.com/oneclickvirt/UnlockTests/utils"
|
|
"github.com/oneclickvirt/defaultset"
|
|
)
|
|
|
|
func MediaTest(language string) string {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
fmt.Fprintf(os.Stderr, "[WARN] MediaTest panic: %v\n", r)
|
|
}
|
|
}()
|
|
|
|
var res string
|
|
readStatus := executor.ReadSelect(language, "0")
|
|
if !readStatus {
|
|
return ""
|
|
}
|
|
if executor.IPV4 {
|
|
res += defaultset.Blue("IPV4:") + "\n"
|
|
res += executor.RunTests(utils.Ipv4HttpClient, "ipv4", language, false)
|
|
return res
|
|
}
|
|
if executor.IPV6 {
|
|
res += defaultset.Blue("IPV6:") + "\n"
|
|
res += executor.RunTests(utils.Ipv6HttpClient, "ipv6", language, false)
|
|
return res
|
|
}
|
|
return ""
|
|
}
|