package main import ( "flag" "fmt" "log" "git.trj.tw/golang/go-ddns-svc/module/apis/aws" "git.trj.tw/golang/go-ddns-svc/module/config" "git.trj.tw/golang/go-ddns-svc/module/option" "git.trj.tw/golang/go-ddns-svc/route/routes" ) func init() { option.RegOptions() } func main() { var err error opts := option.GetOptions() if opts.Help { flag.Usage() return } err = config.LoadConfig(opts.Config) if err != nil { log.Fatal(err) } conf := config.GetConfig() err = aws.NewAWS() if err != nil { log.Fatal(err) } engine := routes.NewEngine() routes.SetRoutes() engine.Run(fmt.Sprintf(":%d", conf.Port)) }