mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-15 00:30:24 +08:00
使用KV数据库来管理IP名单
This commit is contained in:
@@ -2,7 +2,11 @@
|
||||
|
||||
package testutils
|
||||
|
||||
import "os"
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"os"
|
||||
)
|
||||
|
||||
// IsSingleTesting 判断当前测试环境是否为单个函数测试
|
||||
func IsSingleTesting() bool {
|
||||
@@ -12,4 +16,9 @@ func IsSingleTesting() bool {
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// RandIP 生成一个随机IP用于测试
|
||||
func RandIP() string {
|
||||
return fmt.Sprintf("%d.%d.%d.%d", rand.Int()%255, rand.Int()%255, rand.Int()%255, rand.Int()%255)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user