mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-17 15:12:26 +08:00
refactor
This commit is contained in:
23
cmd/hk4e/gate.go
Normal file
23
cmd/hk4e/gate.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"hk4e/gate/app"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// GateCmd 检查配表命令
|
||||
func GateCmd() *cobra.Command {
|
||||
var cfg string
|
||||
c := &cobra.Command{
|
||||
Use: "gate",
|
||||
Short: "gate server",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return app.Run(context.Background(), cfg)
|
||||
},
|
||||
}
|
||||
c.Flags().StringVar(&cfg, "config", "application.toml", "config file")
|
||||
return c
|
||||
}
|
||||
Reference in New Issue
Block a user