wip: 周天,继续
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
||||
"uauth/internal/opt"
|
||||
"uauth/internal/serve"
|
||||
"uauth/internal/store/cache"
|
||||
"uauth/internal/store/db"
|
||||
"uauth/internal/tool"
|
||||
)
|
||||
|
||||
@ -14,6 +15,7 @@ func initServe() *cobra.Command {
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
tool.TablePrinter(opt.Cfg)
|
||||
tool.Must(cache.Init(opt.Cfg.Svc.Cache))
|
||||
tool.Must(db.Init(cmd.Context(), opt.Cfg.Svc.DB))
|
||||
return serve.Run(cmd.Context())
|
||||
},
|
||||
}
|
||||
@ -21,6 +23,7 @@ func initServe() *cobra.Command {
|
||||
svc.Flags().StringVar(&opt.Cfg.Svc.Address, "address", "localhost:8080", "listen address")
|
||||
svc.Flags().StringVar(&opt.Cfg.Svc.Prefix, "prefix", "/api/oauth/v2", "api prefix")
|
||||
svc.Flags().StringVar(&opt.Cfg.Svc.Cache, "cache", "lru::", "cache uri")
|
||||
svc.Flags().StringVar(&opt.Cfg.Svc.DB, "db", "sqlite::data.sqlite", "database uri")
|
||||
|
||||
return svc
|
||||
}
|
||||
|
Reference in New Issue
Block a user