wip: 刚刚开始, 探索阶段

This commit is contained in:
loveuer
2024-10-23 17:46:15 +08:00
commit eb1744bd0d
10 changed files with 249 additions and 0 deletions

30
internal/cmd/cmd.go Normal file
View File

@ -0,0 +1,30 @@
package cmd
import (
"github.com/loveuer/nf/nft/log"
"github.com/spf13/cobra"
"uauth/internal/opt"
)
var (
Command = &cobra.Command{
Use: "uauth",
Short: "uauth: oauth v2 server",
Example: "",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if opt.Cfg.Debug {
log.SetLogLevel(log.LogLevelDebug)
}
},
}
)
func init() {
Command.PersistentFlags().BoolVar(&opt.Cfg.Debug, "debug", false, "debug mode")
initServe()
Command.AddCommand(
initServe(),
)
}

11
internal/cmd/serve.go Normal file
View File

@ -0,0 +1,11 @@
package cmd
import "github.com/spf13/cobra"
func initServe() *cobra.Command {
serve := &cobra.Command{
Use: "serve",
}
return serve
}