middleware

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth() router.HandlerFunc

Auth 认证中间件

func CORS

func CORS(allowOrigins ...string) router.HandlerFunc

CORS 跨域中间件

func Guest

func Guest() router.HandlerFunc

Guest 访客中间件(未登录用户)

func Logger

func Logger() router.HandlerFunc

Logger 日志中间件

func Recovery

func Recovery() router.HandlerFunc

Recovery 恢复中间件(已由 Gin 提供,这里提供自定义版本)

func Throttle

func Throttle(maxRequests int, duration time.Duration) router.HandlerFunc

Throttle 限流中间件

func Timeout

func Timeout(timeout time.Duration) router.HandlerFunc

Timeout 超时中间件

func TrimTrailingSlash

func TrimTrailingSlash() router.HandlerFunc

TrimTrailingSlash 去除尾部斜杠中间件

func ValidateJSON

func ValidateJSON(schema interface{}) router.HandlerFunc

ValidateJSON 验证 JSON 中间件

Types

This section is empty.

Jump to

Keyboard shortcuts

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