Documentation ¶
Overview ¶
Package ratelimit API 限流中间件
这是以用户或是客户端为单位的限流中间件,如果需要按路由进行限流,需为每个路由指定一个实例。
NOTE: 所有数据保存在 web.Cache 之中,缓存服务重启后数据也将重置。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Ratelimit ¶
type Ratelimit struct {
// contains filtered or unexported fields
}
func (*Ratelimit) Middleware ¶
func (rate *Ratelimit) Middleware(next web.HandlerFunc, method, path, router string) web.HandlerFunc
Click to show internal directories.
Click to hide internal directories.