Skip to content

Design a rate limiter using Go and Redis to deny requests when they go over the threshold.

Notifications You must be signed in to change notification settings

lowc1012/rate-limiter-with-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rate-limiter-with-go

Rate limiting algorithms

This implementation supports the following rate limiting strategies:

  • Token bucket
  • Leaky bucket
  • Fixed window (TODO)
  • Sliding window (TODO)

Storage

This implementation supports the following storage backends:

  • Redis
  • In-memory (TODO)

Run this example

go run main.go

# execute this instruction many times
curl --header "X-Forwarded-For: 127.0.0.1" localhost:8080/api/v1/hello

About

Design a rate limiter using Go and Redis to deny requests when they go over the threshold.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages