cmd

package
v0.0.0-...-a0536d5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Main = gcmd.Command{
		Name:  "main",
		Usage: "main",
		Brief: "start http server",
		Func: func(ctx g.Ctx, parser *gcmd.Parser) (err error) {
			s := g.Server()

			s.Use(router.MiddlewareCORS)
			s.Group("/", func(group *ghttp.RouterGroup) {
				router.BindController(group)
			})
			enhanceOpenAPIDoc(s)

			if cachecfg.IsEnabled() {
				go preloadCache()
			}

			s.Run()
			return nil
		},
	}
)

Main is the entry-point CLI command that starts the HTTP server with CORS middleware and OpenAPI docs. 主命令入口,启动 HTTP 服务器并挂载 CORS 中间件与 OpenAPI 文档。

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL