middleware

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth() gin.HandlerFunc

func CasbinHandler

func CasbinHandler() gin.HandlerFunc

CasbinHandler 拦截器

func Cors

func Cors() gin.HandlerFunc

Cors 处理跨域请求,支持options访问

func ErrorHandling

func ErrorHandling() gin.HandlerFunc

func ErrorToMail

func ErrorToMail() gin.HandlerFunc

func Ip

func Ip() gin.HandlerFunc

func IpLimit

func IpLimit() gin.HandlerFunc

func Logging

func Logging() gin.HandlerFunc

func SSLRedirect

func SSLRedirect() gin.HandlerFunc

Types

type RateLimiter

type RateLimiter struct {
	// contains filtered or unexported fields
}

RateLimiter 定义限流器结构体

func NewRateLimiter

func NewRateLimiter(fillInterval time.Duration, capacity int64) *RateLimiter

NewRateLimiter 创建并返回一个限流器实例

func (*RateLimiter) RateLimiterMiddleware

func (r *RateLimiter) RateLimiterMiddleware() gin.HandlerFunc

RateLimiterMiddleware 限流中间件

Jump to

Keyboard shortcuts

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