middleware

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

README

中间件使用规范

1. 中间件分为:接收请求后[全局中间件PreMiddleware] 校验完路由后[Middleware]

2. 全局中间件规则[PreMiddleware]

3. Middleware局部中间件是绑定在路由规则上的,请参数router的文档

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalMiddleware []PreMiddleware

GlobalMiddleware 挂载全局中间件处理

Functions

This section is empty.

Types

type Middleware

type Middleware interface {
	Handle(ctx *context.Context) bool
}

Middleware 路由校验完毕后的中间件处理

type PreMiddleware

type PreMiddleware interface {
	Handle(w http.ResponseWriter, r *http.Request) bool
}

PreMiddleware 请求处理前的处理中间件 - 此时路由还未做校验

Jump to

Keyboard shortcuts

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