middleware

package
v1.0.22 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(secret string, username string, expireHours int) (string, error)

GenerateToken 生成 JWT Token

func JWTAuth

func JWTAuth(secret string) gin.HandlerFunc

JWTAuth JWT 验证中间件

func RateLimit

func RateLimit(maxPerMin int) gin.HandlerFunc

RateLimit IP 限速中间件(滑动窗口算法)

func SignAuth

func SignAuth(cfg *config.Config) gin.HandlerFunc

SignAuth HMAC 签名验证中间件

func StartNonceCleaner

func StartNonceCleaner(ttl int)

StartNonceCleaner 启动定时清理过期 Nonce

Types

This section is empty.

Jump to

Keyboard shortcuts

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