8 instantiations of RateLimiterOptions
Microsoft.AspNetCore.RateLimiting.Tests (8)
RateLimitingApplicationBuilderExtensionsTests.cs (1)
42
var options = new
RateLimiterOptions
();
RateLimitingMetricsTests.cs (1)
346
private IOptions<RateLimiterOptions> CreateOptionsAccessor() => Options.Create(new
RateLimiterOptions
());
RateLimitingMiddlewareTests.cs (1)
656
private IOptions<RateLimiterOptions> CreateOptionsAccessor() => Options.Create(new
RateLimiterOptions
());
RateLimitingOptionsTests.cs (5)
15
var options = new
RateLimiterOptions
();
22
var options = new
RateLimiterOptions
();
29
var options = new
RateLimiterOptions
();
36
var options = new
RateLimiterOptions
();
44
var options = new
RateLimiterOptions
();
38 references to RateLimiterOptions
Microsoft.AspNetCore.RateLimiting (24)
RateLimiterApplicationBuilderExtensions.cs (1)
36
public static IApplicationBuilder UseRateLimiter(this IApplicationBuilder app,
RateLimiterOptions
options)
RateLimiterEndpointConventionBuilderExtensions.cs (1)
45
endpointBuilder.Metadata.Add(new EnableRateLimitingAttribute(new DefaultRateLimiterPolicy(
RateLimiterOptions
.ConvertPartitioner<TPartitionKey>(null, policy.GetPartition), policy.OnRejected)));
RateLimiterOptions.cs (3)
48
public
RateLimiterOptions
AddPolicy<TPartitionKey>(string policyName, Func<HttpContext, RateLimitPartition<TPartitionKey>> partitioner)
67
public
RateLimiterOptions
AddPolicy<TPartitionKey, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TPolicy>(string policyName) where TPolicy : IRateLimiterPolicy<TPartitionKey>
92
public
RateLimiterOptions
AddPolicy<TPartitionKey>(string policyName, IRateLimiterPolicy<TPartitionKey> policy)
RateLimiterOptionsExtensions.cs (16)
19
/// <param name="options">The <see cref="
RateLimiterOptions
"/> to add a limiter to.</param>
22
/// <returns>This <see cref="
RateLimiterOptions
"/>.</returns>
27
public static
RateLimiterOptions
AddTokenBucketLimiter(this
RateLimiterOptions
options, string policyName, Action<TokenBucketRateLimiterOptions> configureOptions)
48
/// <param name="options">The <see cref="
RateLimiterOptions
"/> to add a limiter to.</param>
51
/// <returns>This <see cref="
RateLimiterOptions
"/>.</returns>
56
public static
RateLimiterOptions
AddFixedWindowLimiter(this
RateLimiterOptions
options, string policyName, Action<FixedWindowRateLimiterOptions> configureOptions)
77
/// <param name="options">The <see cref="
RateLimiterOptions
"/> to add a limiter to.</param>
80
/// <returns>This <see cref="
RateLimiterOptions
"/>.</returns>
85
public static
RateLimiterOptions
AddSlidingWindowLimiter(this
RateLimiterOptions
options, string policyName, Action<SlidingWindowRateLimiterOptions> configureOptions)
106
/// <param name="options">The <see cref="
RateLimiterOptions
"/> to add a limiter to.</param>
109
/// <returns>This <see cref="
RateLimiterOptions
"/>.</returns>
110
public static
RateLimiterOptions
AddConcurrencyLimiter(this
RateLimiterOptions
options, string policyName, Action<ConcurrencyLimiterOptions> configureOptions)
RateLimiterServiceCollectionExtensions.cs (2)
18
/// <param name="configureOptions">A delegate to configure the <see cref="
RateLimiterOptions
"/>.</param>
20
public static IServiceCollection AddRateLimiter(this IServiceCollection services, Action<
RateLimiterOptions
> configureOptions)
RateLimitingMiddleware.cs (1)
35
public RateLimitingMiddleware(RequestDelegate next, ILogger<RateLimitingMiddleware> logger, IOptions<
RateLimiterOptions
> options, IServiceProvider serviceProvider, RateLimitingMetrics metrics)
Microsoft.AspNetCore.RateLimiting.Tests (14)
RateLimitingApplicationBuilderExtensionsTests.cs (1)
42
var
options = new RateLimiterOptions();
RateLimitingMetricsTests.cs (4)
187
serviceProvider.GetRequiredService<IOptions<
RateLimiterOptions
>>(),
262
serviceProvider.GetRequiredService<IOptions<
RateLimiterOptions
>>(),
335
private RateLimitingMiddleware CreateTestRateLimitingMiddleware(IOptions<
RateLimiterOptions
> options, ILogger<RateLimitingMiddleware> logger = null, IServiceProvider serviceProvider = null, IMeterFactory meterFactory = null, RequestDelegate next = null)
346
private IOptions<
RateLimiterOptions
> CreateOptionsAccessor() => Options.Create(new RateLimiterOptions());
RateLimitingMiddlewareTests.cs (4)
560
var defaultRateLimiterPolicy = new DefaultRateLimiterPolicy(
RateLimiterOptions
.ConvertPartitioner<string>(null, policy.GetPartition), policy.OnRejected);
590
var defaultRateLimiterPolicy = new DefaultRateLimiterPolicy(
RateLimiterOptions
.ConvertPartitioner<string>(null, policy.GetPartition), policy.OnRejected);
646
private RateLimitingMiddleware CreateTestRateLimitingMiddleware(IOptions<
RateLimiterOptions
> options, ILogger<RateLimitingMiddleware> logger = null, IServiceProvider serviceProvider = null) =>
656
private IOptions<
RateLimiterOptions
> CreateOptionsAccessor() => Options.Create(new RateLimiterOptions());
RateLimitingOptionsTests.cs (5)
15
var
options = new RateLimiterOptions();
22
var
options = new RateLimiterOptions();
29
var
options = new RateLimiterOptions();
36
var
options = new RateLimiterOptions();
44
var
options = new RateLimiterOptions();