Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RateLimitMiddleware ¶ added in v0.10.0
func RateLimitMiddleware(ctx context.Context, rps float64, burst int) func(http.Handler) http.Handler
RateLimitMiddleware returns per-IP token bucket middleware. rps is the sustained rate (requests per second); burst is the bucket capacity. Each unique client IP gets its own limiter. Visitors not seen for 3 minutes are purged from the in-memory map by a background goroutine that exits when ctx is canceled.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is an HTTP API server that exposes memory operations.
Click to show internal directories.
Click to hide internal directories.