StellaOps.Router.Gateway.RateLimiting.Valkey
Valkey store for the environment-scope rate limit of StellaOps.Router.Gateway Install Installing Stella Ops packagesRouter downloads and signaturesnet10.01.0.1-20261117T070237Zdotnet add package StellaOps.
Namespaces
| Namespace | Types |
|---|---|
StellaOps. | 2 |
namespace StellaOps.Router.Gateway.RateLimiting.Valkey
| Type | Kind | Description |
|---|---|---|
RouterValkeyRateLimitStoreServiceCollectionExtensions | class | Registers the Valkey store of the gateway’s environment-scope rate limit (rate_). |
ValkeyRateLimitStore | class | Valkey-backed fixed-window rate limit store. |
class RouterValkeyRateLimitStoreServiceCollectionExtensions
public static class RouterValkeyRateLimitStoreServiceCollectionExtensions
Registers the Valkey store of the gateway’s environment-scope rate limit (rate_).
Members
| Member | Kind | Summary |
|---|---|---|
AddRouterValkeyRateLimitStore( | extension method | Registers ValkeyRateLimitStoreas the IValkeyRateLimitStoreof the environment rate limit. |
extension method AddRouterValkeyRateLimitStore(IServiceCollection) #
AddRouterValkeyRateLimitStore(IServiceCollection) #public static IServiceCollection AddRouterValkeyRateLimitStore(this IServiceCollection services)
Registers ValkeyRateLimitStoreas the IValkeyRateLimitStoreof the environment rate limit. The store connects to rate_ and keeps its counters under valkey_bucket, read from the RateLimitConfigthat Add registers; it is created only when environment rules are configured, and it connects on the first request. A store registered before this call is kept.
Parameters
services: The service collection.
Returns
The service collection for chaining.
class ValkeyRateLimitStore
public sealed class ValkeyRateLimitStore : IValkeyRateLimitStore, IDisposable
Valkey-backed fixed-window rate limit store.
Members
| Member | Kind | Summary |
|---|---|---|
ValkeyRateLimitStore( | constructor | Creates a store over a Valkey server. |
Dispose( | method | See IDisposable.. |
IncrementAndCheckAsync( | method | Atomically increment counters for the provided rules and determine if the request is allowed. |
constructor ValkeyRateLimitStore(string, string, ILogger<ValkeyRateLimitStore>) #
ValkeyRateLimitStore(string, string, ILogger<ValkeyRateLimitStore>) #public ValkeyRateLimitStore(string connectionString, string bucket, ILogger<ValkeyRateLimitStore>? logger = null)
Creates a store over a Valkey server.
Parameters
connectionString: The Valkey connection string.bucket: The key prefix that separates this store’s counters.logger: Receives the store diagnostics; none when not set.
method Dispose() #
Dispose() #public void Dispose()
See IDisposable..
method IncrementAndCheckAsync(string, IReadOnlyList<RateLimitRule>, CancellationToken) #
IncrementAndCheckAsync(string, IReadOnlyList<RateLimitRule>, CancellationToken) #public Task<RateLimitStoreResult> IncrementAndCheckAsync(string key, IReadOnlyList<RateLimitRule> rules, CancellationToken cancellationToken)
Atomically increment counters for the provided rules and determine if the request is allowed.