golang-echo-simple-rate-limit-middleware

command module
v0.0.0-...-52085dd Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2019 License: MIT Imports: 3 Imported by: 0

README

golang-echo-simple-rate-limit-middleware

Rate limit middleware for golang echo framework

Requirements

Usage

As any other middleware:

e := echo.New()
e.Use(RateLimitWithConfig(RateLimitConfig{
  Limit: 2,
  Burst: 2,
}))

run your server and try out the middleware easily with curl

while true; do curl https://localhost:8080 --insecure; done

responses

...
...
...
HTTP/2 200 
access-control-allow-origin: 
content-type: application/json; charset=UTF-8
vary: Accept-Encoding
vary: Origin
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-request-id: eVdqddyz8XHFJ2UgDjlOb7QbfY23Hfyi
x-xss-protection: 1; mode=block
content-length: 32
date: Sat, 17 Aug 2019 13:59:49 GMT

{"application":"","version":""}
HTTP/2 429 
content-type: application/json; charset=UTF-8
content-length: 32
date: Sat, 17 Aug 2019 13:59:49 GMT

{"message":"Too Many Requests"}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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