-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmain.go
31 lines (28 loc) · 884 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"flag"
"github.com/YouChenJun/CheckCdn/client"
"github.com/YouChenJun/CheckCdn/cmd"
)
var (
inputIpFilePath = flag.String("input", "", "需要检测的ip文件列表")
noCdnIP = flag.String("output", "nocdn.txt", "不是CDN节点的ip文本列表")
configFilePath = flag.String("config", "config.yaml", "配置文件夹路径")
delaySeconds = flag.Float64("delayed", 0, "查询延迟时间,默认0s")
dbPath = flag.String("db", "", "ipdb数据库路径,默认为当前目录下的cdn_cache.db")
)
func main() {
flag.Parse()
// 设置数据库路径
if *dbPath != "" {
client.SetDBPath(*dbPath)
}
runnerConfig := &cmd.RunnerConfig{
InputIpFilePath: *inputIpFilePath,
NoCdnIP: *noCdnIP,
ConfigFilePath: *configFilePath,
DelaySeconds: *delaySeconds,
DbPath: *dbPath,
}
cmd.Run(runnerConfig)
}