forked from Sansui233/proxypoolCheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
40 lines (33 loc) · 826 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
32
33
34
35
36
37
38
39
40
package main
import (
"flag"
"github.com/vrichv/proxypoolCheck/api"
"github.com/vrichv/proxypoolCheck/config"
"github.com/vrichv/proxypoolCheck/internal/app"
"github.com/vrichv/proxypoolCheck/internal/cron"
"log"
"net/http"
)
var configFilePath = ""
func main() {
go func() {
http.ListenAndServe("0.0.0.0:6061", nil)
}()
//Slog.SetLevel(Slog.DEBUG) // Print original pack log
// fetch configuration
flag.StringVar(&configFilePath, "c", "", "path to config file: config.yaml")
flag.Parse()
if configFilePath == "" {
configFilePath = "config.yaml"
}
err := config.Parse(configFilePath)
if err != nil {
log.Fatal(err, "\n\"Config file err. Exit\"")
return
}
go app.InitApp()
log.Printf("The program will run every %v minutes\n", config.Config.CronInterval)
go cron.Cron()
// Run
api.Run()
}