mux

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 20 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTP

func HTTP(callback Callback) cago.ComponentCancel

HTTP http服务组件,需要先注册logger组件

func Metadata added in v1.1.0

func Metadata(request interface{}) (string, string)

func Recover

func Recover() gin.HandlerFunc

func RegisterMiddleware

func RegisterMiddleware(f RegisterMiddlewareFunc)

func ShouldBindWith

func ShouldBindWith(c *gin.Context, obj any) error

Types

type Callback

type Callback func(ctx context.Context, r *Router) error

type Config

type Config struct {
	Address []string `yaml:"address"`
}

type Meta

type Meta struct {
}

Meta 路由

type RegisterMiddlewareFunc

type RegisterMiddlewareFunc func(cfg *configs.Config, router *gin.Engine) error

type Router

type Router struct {
	*Routes
	gin.IRouter
}

func (*Router) Group

func (r *Router) Group(path string, handler ...gin.HandlerFunc) *Router

func (*Router) Use added in v1.1.0

func (r *Router) Use(handler ...gin.HandlerFunc) *Routes

type Routes added in v1.1.0

type Routes struct {
	gin.IRoutes
}

func (*Routes) Bind added in v1.1.0

func (r *Routes) Bind(handler ...interface{})

Bind 绑定控制器

func (*Routes) RequestHandle added in v1.1.0

func (r *Routes) RequestHandle(request interface{}, handlers ...gin.HandlerFunc) *Routes

type Validate

type Validate interface {
	Validate(ctx context.Context) error
}

Validate 数据校验

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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