Registry / web-framework / go-chi-httprate

go-chi-httprate

JSON →
library0.15.0gogounverified

An HTTP rate limiter middleware for Go's chi router, providing per-route or global rate limiting.

go get github.com/go-chi/httprate
INSTALL
IMPORT
SIG · GO-CHI-HTTPRATE
G
go-chi-httprate
web-frameworkgov0.15.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

httprate
github.com/go-chi/httprate

Apply rate limiting of 10 requests per minute per IP to all routes.

package main import ( "net/http" "github.com/go-chi/chi/v5" "github.com/go-chi/httprate" ) func main() { r := chi.NewRouter() r.Use(httprate.LimitByIP(10, 1*time.Minute)) r.Get("/", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello")) }) http.ListenAndServe(":8080", r) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.15.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
go-chi-httprate — go get go-chi-httprate · libregistry