Skip to content

mzampetakis/reili

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reili

A simple but general purpose http Rate Limiter

Installing

$ go get -u github.com/mzampetakis/reili

Usage

Define your own identifier function

IdentifyVisitor(r *http.Request) (string, error)

following the interface that package reili provides

type VisitorIdentifier interface {
	IdentifyVisitor(r *http.Request) (string, error)
}

Create a rate limiter using reili.NewRateLimiter(reqPerSec, burstReq, visitorIdentifier) and then limit your server's mux using your limiter.

Examples

Limit by request IP

About

A general purpose http Rate Limiter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages