Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "start", Short: "vblog项目后端", Long: ``, Run: func(cmd *cobra.Command, args []string) { switch configType { case "env": _, err := conf.LoadConfigFromEnv() cobra.CheckErr(err) default: _, err := conf.LoadConfigFromToml(configFile) cobra.CheckErr(err) } tracer.InitTracer() httpServer := protocol.NewHttp() go func() { herr := httpServer.Start() if herr != http.ErrServerClosed { cobra.CheckErr(herr) } }() grpcServer := protocol.NewGrpc() go func() { gerr := grpcServer.Start() cobra.CheckErr(gerr) }() err := ioc.InitIocObject() cobra.CheckErr(err) ch := make(chan os.Signal, 1) signal.Notify(ch, syscall.SIGTERM, syscall.SIGINT, syscall.SIGHUP, syscall.SIGQUIT) s := <-ch logger.L().Info().Msgf("receive os signal: %s, exit ...", s) ctx := context.Background() httpServer.Stop(ctx) grpcServer.Stop(ctx) conf.C().MySQL.Close() }, }
root command vblog-api start
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.