4 instantiations of RateLimitPartition
Microsoft.AspNetCore.RateLimiting (1)
RateLimiterOptions.cs (1)
115return new RateLimitPartition<DefaultKeyType>(partitionKey, static key => ((Func<TPartitionKey, RateLimiter>)key.Factory!)((TPartitionKey)key.Key!));
Microsoft.AspNetCore.RateLimiting.Tests (2)
RateLimitingMiddlewareTests.cs (2)
475return new RateLimitPartition<string>(duplicateKey, partitionKey => 482return new RateLimitPartition<string>(duplicateKey, partitionKey =>
System.Threading.RateLimiting (1)
System\Threading\RateLimiting\RateLimitPartition.cs (1)
25return new RateLimitPartition<TKey>(partitionKey, factory);
24 references to RateLimitPartition
Microsoft.AspNetCore.RateLimiting (9)
DefaultRateLimiterPolicy.cs (3)
11private readonly Func<HttpContext, RateLimitPartition<DefaultKeyType>> _partitioner; 14public DefaultRateLimiterPolicy(Func<HttpContext, RateLimitPartition<DefaultKeyType>> partitioner, Func<OnRejectedContext, CancellationToken, ValueTask>? onRejected) 22public RateLimitPartition<DefaultKeyType> GetPartition(HttpContext httpContext)
IRateLimiterPolicy.cs (2)
20/// Gets the <see cref="RateLimitPartition{TPartitionKey}"/> that applies to the given <see cref="HttpContext"/>. 23RateLimitPartition<TPartitionKey> GetPartition(HttpContext httpContext);
RateLimiterOptions.cs (4)
48public RateLimiterOptions AddPolicy<TPartitionKey>(string policyName, Func<HttpContext, RateLimitPartition<TPartitionKey>> partitioner) 109internal static Func<HttpContext, RateLimitPartition<DefaultKeyType>> ConvertPartitioner<TPartitionKey>(string? policyName, Func<HttpContext, RateLimitPartition<TPartitionKey>> partitioner) 113RateLimitPartition<TPartitionKey> partition = partitioner(context);
Microsoft.AspNetCore.RateLimiting.Tests (1)
TestRateLimiterPolicy.cs (1)
28public RateLimitPartition<string> GetPartition(HttpContext httpContext)
RateLimitingSample (1)
SampleRateLimiterPolicy.cs (1)
26public RateLimitPartition<string> GetPartition(HttpContext httpContext)
System.Threading.RateLimiting (13)
System\Threading\RateLimiting\DefaultPartitionedRateLimiter.cs (4)
15private readonly Func<TResource, RateLimitPartition<TKey>> _partitioner; 35public DefaultPartitionedRateLimiter(Func<TResource, RateLimitPartition<TKey>> partitioner, 42private DefaultPartitionedRateLimiter(Func<TResource, RateLimitPartition<TKey>> partitioner, 89RateLimitPartition<TKey> partition = _partitioner(resource);
System\Threading\RateLimiting\PartitionedRateLimiter.cs (2)
23/// If the <see cref="RateLimitPartition{TKey}.PartitionKey"/> matches a cached entry then the rate limiter previously used for that key is used. Otherwise, the factory is called to get a new rate limiter.</param> 27Func<TResource, RateLimitPartition<TPartitionKey>> partitioner,
System\Threading\RateLimiting\RateLimitPartition.cs (6)
21public static RateLimitPartition<TKey> Get<TKey>( 35public static RateLimitPartition<TKey> GetConcurrencyLimiter<TKey>( 49public static RateLimitPartition<TKey> GetNoLimiter<TKey>(TKey partitionKey) 64public static RateLimitPartition<TKey> GetTokenBucketLimiter<TKey>( 98public static RateLimitPartition<TKey> GetSlidingWindowLimiter<TKey>( 132public static RateLimitPartition<TKey> GetFixedWindowLimiter<TKey>(
System\Threading\RateLimiting\RateLimitPartition.T.cs (1)
13/// Constructs the <see cref="RateLimitPartition{TKey}"/> for use in <see cref="PartitionedRateLimiter.Create"/>.