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.
tollbooth
✓ github.com/didip/tollbooth/v6
Create a rate-limited HTTP handler
package main
import (
"net/http"
"github.com/didip/tollbooth/v6"
)
func main() {
limiter := tollbooth.NewLimiter(1, nil)
http.Handle("/", tollbooth.LimitFuncHandler(limiter, func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello, World!"))
}))
http.ListenAndServe(":8080", nil)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
6.1.2latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.