Skip to content

SharkableIO/Sharkable.Cache.Redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sharkable.Cache.Redis

Sharkable

Redis-backed distributed stores for Sharkable.

Install

dotnet add package Sharkable.Cache.Redis

Usage

// Register before AddShark()
builder.Services.AddSharkableRedis("localhost:6379");

builder.Services.AddShark(opt =>
{
    opt.EnableIdempotency = true;
    opt.ConfigureRateLimiting(o => o.DefaultLimit = 100);
});

Stores

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.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages