Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "demo-api", Short: "demo-api 后端API", Long: "demo-api 后端API", RunE: func(cmd *cobra.Command, args []string) error { if vers { fmt.Println(version.FullVersion()) return nil } return nil }, }
RootCmd represents the base command when called without any subcommands
View Source
var StartCmd = &cobra.Command{ Use: "start", Short: "启动 demo 后端API", Long: "启动 demo 后端API", RunE: func(cmd *cobra.Command, args []string) error { err := conf.LoadConfigFromToml(confFile) if err != nil { return err } if err := loadGlobalLogger(); err != nil { return err } apps.InitImpl() svc := newManager() ch := make(chan os.Signal, 1) defer close(ch) signal.Notify(ch, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP, syscall.SIGINT) go svc.WaitStop(ch) return svc.Start() }, }
程序的启动时 组装都在这里进行 1. StartCmd represents the base command when called without any subcommands
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.