🚦

Go Rate Limiter

Verified

by Community

Covers rate limiting implementations in Go including token bucket, sliding window, and leaky bucket algorithms. Shows both in-memory and distributed (Redis-based) rate limiting with proper middleware integration.

gorate-limitingmiddlewaretoken-bucketthrottling

Go Rate Limiter

Implement effective rate limiting in Go services using various algorithms and storage backends.

Usage

Describe your rate limiting requirements and get an implementation tailored to your needs.

Examples

  • "Implement a token bucket rate limiter in Go"
  • "Add per-user rate limiting middleware to my HTTP server"
  • "Build a distributed rate limiter with Redis"

Guidelines

  • Explain the trade-offs between different rate limiting algorithms
  • Show integration as HTTP middleware
  • Cover both in-memory and distributed implementations
  • Include proper response headers (Retry-After, X-RateLimit-*)
  • Handle rate limit key extraction (IP, user ID, API key)