_router

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RouterList []*Router = []*Router{}

Functions

func Any

func Any(rule string, call func(ctx *_context.Context))

func Business added in v1.2.0

func Business(business string) *router

func Delete

func Delete(rule string, call func(ctx *_context.Context))

func Get

func Get(rule string, call func(ctx *_context.Context))

func Group

func Group(group func())
func Head(rule string, call func(ctx *_context.Context))

func Method

func Method(method string, rule string, call func(ctx *_context.Context))

func MethodList

func MethodList(methodList []string, rule string, call func(ctx *_context.Context))

func MiddlewareAfter

func MiddlewareAfter(middleware func(ctx *_context.Context)) *router

func MiddlewareAfterList

func MiddlewareAfterList(middlewareList []func(ctx *_context.Context)) *router

func MiddlewareBefore

func MiddlewareBefore(middleware func(ctx *_context.Context)) *router

func MiddlewareBeforeList

func MiddlewareBeforeList(middlewareList []func(ctx *_context.Context)) *router

func Options

func Options(rule string, call func(ctx *_context.Context))

func Patch

func Patch(rule string, call func(ctx *_context.Context))

func Post

func Post(rule string, call func(ctx *_context.Context))

func Prefix

func Prefix(prefix string) *router

func Put

func Put(rule string, call func(ctx *_context.Context))

Types

type Router

type Router struct {
	Business             string                        // 业务标识
	Rule                 string                        // 路径
	Call                 func(ctx *_context.Context)   // 处理方法
	MethodList           []string                      // 方法列表
	MiddlewareBeforeList []func(ctx *_context.Context) // 前中间件列表
	MiddlewareAfterList  []func(ctx *_context.Context) // 后中间件列表
	Parameter            map[string]string             // 正则路径解析参数
	IsRegexp             bool                          // 是否使用正则匹配
}

Jump to

Keyboard shortcuts

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