wip: 继续, client, svc 同步进行
This commit is contained in:
16
internal/cmd/client.go
Normal file
16
internal/cmd/client.go
Normal file
@ -0,0 +1,16 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
"uauth/internal/client"
|
||||
)
|
||||
|
||||
func initClient() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "client",
|
||||
Short: "Run the client",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return client.Run(cmd.Context())
|
||||
},
|
||||
}
|
||||
}
|
@ -26,5 +26,6 @@ func init() {
|
||||
|
||||
Command.AddCommand(
|
||||
initServe(),
|
||||
initClient(),
|
||||
)
|
||||
}
|
||||
|
@ -23,7 +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.Prefix, "prefix", "/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")
|
||||
|
||||
|
Reference in New Issue
Block a user