ratelimit

package
v0.33.4 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig

func GetConfig(ctx context.Context, c *app.RequestContext)

GetConfig . @router /admin/ratelimit/config [GET]

func SetLimiter

func SetLimiter(l *middleware.RateLimiter)

SetLimiter 注入限流器

func Status

func Status(ctx context.Context, c *app.RequestContext)

Status 返回限流器真实运行状态(此前 ActiveClients/BlockedIps 恒 0) @router /admin/ratelimit/status [GET]

func Test

func Test(ctx context.Context, c *app.RequestContext)

Test 对本机限流器实测:以 login 维度向当前客户端 IP 发起 N 次判定, 返回触发位置与实际通过数(此前为硬编码假数据)。 @router /admin/ratelimit/test [POST]

func UpdateConfig

func UpdateConfig(ctx context.Context, c *app.RequestContext)

UpdateConfig . @router /admin/ratelimit/config [PUT]

Types

This section is empty.

Jump to

Keyboard shortcuts

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