proxy-pool/deploy/tools/configcheck/main.go
youfak 4de3ffb85f
Some checks are pending
ci / test (ubuntu-latest) (push) Waiting to run
ci / test (windows-latest) (push) Waiting to run
ci / race (push) Waiting to run
feat: add ephemeral proxy activity pool
2026-07-29 12:51:18 +08:00

30 lines
599 B
Go

// configcheck 使用与进程启动相同的严格加载器校验部署配置。
package main
import (
"fmt"
"os"
"proxy-pool/internal/config"
)
func main() {
if len(os.Args) != 2 {
fmt.Fprintln(os.Stderr, "usage: configcheck CONFIG_FILE")
os.Exit(2)
}
file, err := os.Open(os.Args[1])
if err != nil {
fmt.Fprintf(os.Stderr, "open config: %v\n", err)
os.Exit(1)
}
defer file.Close()
if _, err := config.LoadResolved(file, config.OSResolver{}); err != nil {
fmt.Fprintf(os.Stderr, "invalid config: %v\n", err)
os.Exit(1)
}
fmt.Printf("valid config: %s\n", os.Args[1])
}