Rate limitation middleware for tango
Go to file
Lunny Xiao 1e82392dd7
All checks were successful
checks / check and test (push) Successful in 43s
Fix build
2023-04-20 15:59:47 +08:00
.gitea/workflows Use actions instead of drone 2023-04-20 10:01:05 +08:00
.gitignore init project 2020-07-06 14:36:48 +08:00
go.mod Fix build 2023-04-20 15:59:47 +08:00
go.sum Fix build 2023-04-20 15:59:47 +08:00
limiter_test.go init project 2020-07-06 14:36:48 +08:00
limiter.go init project 2020-07-06 14:36:48 +08:00
README.md Update README 2020-07-06 14:40:27 +08:00

Limiter

Rate limiter for tango, a global limitation

o.Use(limiter.RequestLimit(limiter.New(100, 1, 5*time.Second))

or a limit for a special router

o.Get("/", func(ctx *tango.Context) {}, limiter.RequestLimit(limiter.New(100, 1, 5*time.Second)))