{"repo":"nccapo/rate-limiter","free":true,"listed":false,"github":"https://github.com/nccapo/rate-limiter","clone":"git clone https://github.com/nccapo/rate-limiter.git","description":"A robust, thread-safe, and distributed rate limiter for Go, designed for high-throughput applications.","language":"Go","stars":51,"topics":["gin-gonic","go","golang","rate-limiter","rate-limiting","redis","middleware","token-bu","token-bucket-algorithm","go-rate-limiter"],"license":"MIT","category":"databases-storage","readme_excerpt":"Rate Limiter A robust, thread-safe, and distributed rate limiter for Go, designed for high-throughput applications. It implements the Token Bucket algorithm and supports both Redis (for distributed systems) and In-Memory (for single-instance apps) backends. 🚀 Features 🛡️ Atomic Operations : Leverages Redis Lua scripts to ensure strict rate limiting without race conditions in distributed environments. 💾 Pluggable Storage : Redis : First-class support for go-redis/v9 . Ideal for microservices and load-balanced APIs. In-Memory : fast, thread-safe local storage. Perfect for unit tests or standalone binaries. ⚙️ Functional Options : Clean, idiomatic Go API for configuration ( WithRate , WithStore , etc.). ⏮️ Blocking Support : Wait(ctx, key) method for client-side throttling (like uber-go/ratelimit 's Take ). 🔌 Middleware Ready : Standard net/http middleware included. Specialized Gin middleware available in a sub-package. 🧠 Memory Safe : Automatic TTL management for Redis keys prevents zombie data and memory leaks. 🆕 Thread-Safe : Fixed critical race conditions in v0.7.4. Default RateLimiter is now fully atomic for concurrent use. 🆕 What's New in v0.7.5 Critical Fix : Resolved a data race in RateLimiter where header generation was using shared state. Now uses a thread-safe Allow(ctx, key) API. Circuit Breaker : Fixed a concurrency flaw in the \"Half-Open\" state. It now correctly allows only one probe request at a time, preventing backend overload. API Update : IsRequestAllow","default_branch":null,"files":null,"tree":[],"storefront":"/r/nccapo","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/nccapo/rate-limiter/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}