Redis-backed distributed stores for Sharkable.
dotnet add package Sharkable.Cache.Redis// Register before AddShark()
builder.Services.AddSharkableRedis("localhost:6379");
builder.Services.AddShark(opt =>
{
opt.EnableIdempotency = true;
opt.ConfigureRateLimiting(o => o.DefaultLimit = 100);
});| Feature | Interface | Redis Key Pattern |
|---|---|---|
| Idempotency | IIdempotencyStore |
sharkable:idempotency:{key} |
| Rate limiting | IDistributedRateLimitStore |
sharkable:ratelimit:{key} |
| Health check | IHealthCheck |
auto-registered via DI |
The RateLimitStore uses an atomic Lua script (INCR + conditional EXPIRE) for correct distributed counting.
MIT
