Registry / utility / go-redis-redis-rate-v9

go-redis-redis-rate-v9

JSON →
library9.1.2gogounverified

A rate limiting library for Go using Redis, based on the generic cell rate algorithm.

go get github.com/go-redis/redis_rate/v9
INSTALL
IMPORT
SIG · GO-REDIS-REDIS-RAT
G
go-redis-redis-rate-v9
utilitygov9.1.2
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.

redis_rate
github.com/go-redis/redis_rate/v9

Creates a rate limiter and checks if a request is allowed.

package main import ( "context" "fmt" "github.com/go-redis/redis_rate/v9" "github.com/redis/go-redis/v9" ) func main() { rdb := redis.NewClient(&redis.Options{Addr: "localhost:6379"}) limiter := redis_rate.NewLimiter(rdb) res, err := limiter.Allow(context.Background(), "key", redis_rate.PerSecond(10)) if err != nil { panic(err) } fmt.Println("Allowed:", res.Allowed) }
Debug
Known issues

No known issues recorded.

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

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
go-redis-redis-rate-v9 — go get go-redis-redis-rate-v9 · libregistry