Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "demo-api", Short: "demo-backend-api", Long: "demo-backend-api", RunE: func(cmd *cobra.Command, args []string) error { if vers { fmt.Println(version.FullVersion()) return nil } return nil }, }
View Source
var StartCmd = &cobra.Command{ Use: "start", Short: "启动API", Long: "启动API", RunE: func(cmd *cobra.Command, args []string) error { err := conf.LoadConfigFromToml(confFile) if err = LoadGlobalLogger(); err != nil { return err } if err != nil { return err } err = zap.DevelopmentSetup() if err != nil { return err } apps.InitImpl() svc := core.NewManager() go svc.WaitStop() return svc.Start() }, }
StartCmd 通过cli方式将服务启动起来
Functions ¶
func LoadGlobalLogger ¶
func LoadGlobalLogger() error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.