8 instantiations of RateLimiterOptions
Microsoft.AspNetCore.RateLimiting.Tests (8)
RateLimitingApplicationBuilderExtensionsTests.cs (1)
42var options = new RateLimiterOptions();
RateLimitingMetricsTests.cs (1)
346private IOptions<RateLimiterOptions> CreateOptionsAccessor() => Options.Create(new RateLimiterOptions());
RateLimitingMiddlewareTests.cs (1)
656private IOptions<RateLimiterOptions> CreateOptionsAccessor() => Options.Create(new RateLimiterOptions());
RateLimitingOptionsTests.cs (5)
15var options = new RateLimiterOptions(); 22var options = new RateLimiterOptions(); 29var options = new RateLimiterOptions(); 36var options = new RateLimiterOptions(); 44var options = new RateLimiterOptions();
38 references to RateLimiterOptions
Microsoft.AspNetCore.RateLimiting (24)
RateLimiterApplicationBuilderExtensions.cs (1)
36public static IApplicationBuilder UseRateLimiter(this IApplicationBuilder app, RateLimiterOptions options)
RateLimiterEndpointConventionBuilderExtensions.cs (1)
45endpointBuilder.Metadata.Add(new EnableRateLimitingAttribute(new DefaultRateLimiterPolicy(RateLimiterOptions.ConvertPartitioner<TPartitionKey>(null, policy.GetPartition), policy.OnRejected)));
RateLimiterOptions.cs (3)
48public RateLimiterOptions AddPolicy<TPartitionKey>(string policyName, Func<HttpContext, RateLimitPartition<TPartitionKey>> partitioner) 67public RateLimiterOptions AddPolicy<TPartitionKey, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TPolicy>(string policyName) where TPolicy : IRateLimiterPolicy<TPartitionKey> 92public 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> 27public 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> 56public 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> 85public 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> 110public 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> 20public static IServiceCollection AddRateLimiter(this IServiceCollection services, Action<RateLimiterOptions> configureOptions)
RateLimitingMiddleware.cs (1)
35public RateLimitingMiddleware(RequestDelegate next, ILogger<RateLimitingMiddleware> logger, IOptions<RateLimiterOptions> options, IServiceProvider serviceProvider, RateLimitingMetrics metrics)
Microsoft.AspNetCore.RateLimiting.Tests (14)
RateLimitingApplicationBuilderExtensionsTests.cs (1)
42var options = new RateLimiterOptions();
RateLimitingMetricsTests.cs (4)
187serviceProvider.GetRequiredService<IOptions<RateLimiterOptions>>(), 262serviceProvider.GetRequiredService<IOptions<RateLimiterOptions>>(), 335private RateLimitingMiddleware CreateTestRateLimitingMiddleware(IOptions<RateLimiterOptions> options, ILogger<RateLimitingMiddleware> logger = null, IServiceProvider serviceProvider = null, IMeterFactory meterFactory = null, RequestDelegate next = null) 346private IOptions<RateLimiterOptions> CreateOptionsAccessor() => Options.Create(new RateLimiterOptions());
RateLimitingMiddlewareTests.cs (4)
560var defaultRateLimiterPolicy = new DefaultRateLimiterPolicy(RateLimiterOptions.ConvertPartitioner<string>(null, policy.GetPartition), policy.OnRejected); 590var defaultRateLimiterPolicy = new DefaultRateLimiterPolicy(RateLimiterOptions.ConvertPartitioner<string>(null, policy.GetPartition), policy.OnRejected); 646private RateLimitingMiddleware CreateTestRateLimitingMiddleware(IOptions<RateLimiterOptions> options, ILogger<RateLimitingMiddleware> logger = null, IServiceProvider serviceProvider = null) => 656private IOptions<RateLimiterOptions> CreateOptionsAccessor() => Options.Create(new RateLimiterOptions());
RateLimitingOptionsTests.cs (5)
15var options = new RateLimiterOptions(); 22var options = new RateLimiterOptions(); 29var options = new RateLimiterOptions(); 36var options = new RateLimiterOptions(); 44var options = new RateLimiterOptions();