wip: 继续, client, svc 同步进行

This commit is contained in:
loveuer
2024-10-28 22:37:22 +08:00
parent d1597509bb
commit c696872b8a
6 changed files with 92 additions and 23 deletions

16
internal/cmd/client.go Normal file
View 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())
},
}
}

View File

@ -26,5 +26,6 @@ func init() {
Command.AddCommand(
initServe(),
initClient(),
)
}

View File

@ -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")