Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Name is the name of the compiled software. Name string // Version is the version of the compiled software. Version string )
go build -ldflags "-X main.Version=x.y.z"
View Source
var ServerCmd = &cobra.Command{ Use: "server", Short: "启动服务器", Run: func(cmd *cobra.Command, args []string) { logger := log.With(log.NewStdLogger(os.Stdout), "ts", log.DefaultTimestamp, "caller", log.DefaultCaller, "service.id", id, "service.name", Name, "service.version", Version, "trace.id", tracing.TraceID(), "span.id", tracing.SpanID(), ) c := config.New( config.WithSource( file.NewSource(flagconf), ), ) defer c.Close() if err := c.Load(); err != nil { panic(err) } var bc conf.Bootstrap if err := c.Scan(&bc); err != nil { panic(err) } app, cleanup, err := wireApp(bc.Server, bc.Data, logger) if err != nil { panic(err) } defer cleanup() if err := app.Run(); err != nil { panic(err) } }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.