This commit is contained in:
WJQSERVER 2024-10-11 02:54:16 +08:00
parent 23bb463490
commit 1e496fb09e
6 changed files with 22 additions and 4 deletions

View file

@ -2,6 +2,7 @@ package main
import (
"encoding/json"
"flag"
"fmt"
"log"
"net/http"
@ -21,6 +22,11 @@ var (
configfile = "/data/ghproxy/config/config.yaml"
)
func ReadFlag() {
cfgfile := flag.String("cfg", configfile, "config file path")
configfile = *cfgfile
}
func loadConfig() {
var err error
// 初始化配置
@ -48,6 +54,7 @@ func Loadlist(cfg *config.Config) {
}
func init() {
ReadFlag()
loadConfig()
setupLogger()
Loadlist(cfg)