Speed limitation middleware for tango
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lunny Xiao acaedfa8ee
Fix drone
1 year ago
.drone.yml Fix drone 1 year ago
.gitignore init project 1 year ago
README.md Update README 1 year ago
go.mod init project 1 year ago
go.sum init project 1 year ago
limiter.go init project 1 year ago
limiter_test.go init project 1 year ago

README.md

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)))