cmd

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Main command.
	Main = gcmd.Command{
		Name:  "main",
		Usage: "main",
		Brief: "start http server",
		Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
			s := g.Server()
			s.SetRewrite("/favicon.ico", "/resource/image/favicon.ico")
			s.Group("/api.v1", func(group *ghttp.RouterGroup) {
				group.Middleware(service.Middleware().ConsoleLogger, service.Middleware().Logger, service.Middleware().HandlerResponse)
				group.Group("/console", func(group *ghttp.RouterGroup) {
					group.Bind(
						auth.New(),
					)
				})

				group.Group("/console", func(group *ghttp.RouterGroup) {
					group.Middleware(service.Middleware().AuthorizationForAPI)
					group.Bind(
						echo.New(),
						account.New(),
						short.New(),
					)
				})
				group.Group("/console", func(group *ghttp.RouterGroup) {
					group.Middleware(service.Middleware().AuthorizationForConsole)
					group.Bind(
						home.New(),

						domain.New(),
					)
				})
			})
			s.Run()
			return nil
		},
	}
)

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