Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docs about Rate Limiter Middleware #287

Merged
merged 1 commit into from Jun 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion website/content/middleware/rate-limiter.md
Expand Up @@ -13,13 +13,15 @@ may not be the best option for a high number of concurrent requests or a large n

### Usage

To add a rate limit to your application simply add the `RateLimiter` middlware.
To add a rate limit to your application simply add the `RateLimiter` middleware.
The example below will limit the application to 20 requests/sec using the default in-memory store:

```go
e.Use(middleware.RateLimiter(middleware.NewRateLimiterMemoryStore(20)))
```

Note: if the provided rate is a float number, Burst will be treated as the rounded down value of the rate.

## Custom Configuration

```go
Expand Down