Show / Hide Table of Contents

    Class ThrottlingSentinelOptions

    Configuration options for ThrottlingSentinelMiddleware.

    Inheritance
    System.Object
    ThrottlingSentinelOptions
    Namespace: Cuemon.AspNetCore.Http.Throttling
    Assembly: Cuemon.AspNetCore.dll
    Syntax
    public class ThrottlingSentinelOptions

    Constructors

    | Improve this Doc

    ThrottlingSentinelOptions()

    Initializes a new instance of the ThrottlingSentinelOptions class.

    Declaration
    public ThrottlingSentinelOptions()
    Remarks

    The following table shows the initial property values for an instance of ThrottlingSentinelOptions.

    PropertyInitial Value
    RateLimitHeaderNameX-RateLimit-Limit
    RateLimitRemainingHeaderNameX-RateLimit-Remaining
    RateLimitResetHeaderNameX-RateLimit-Reset
    UseRetryAfterHeadertrue
    RetryAfterHeaderThrottlingRetryAfterHeader.DeltaSeconds
    TooManyRequestsMessageThrottling rate limit quota violation. Quota limit exceeded.
    ContextResolvernull
    Quotanull
    ResponseBrokerA System.Net.Http.HttpResponseMessage initialized to a HTTP status code 429 with zero of one Retry-After header and a body of TooManyRequestsMessage.

    Properties

    | Improve this Doc

    ContextResolver

    Gets or sets the function delegate that will resolve a unique context of the throttling middleware (eg. IP-address, Authorization header, etc.).

    Declaration
    public Func<HttpContext, string> ContextResolver { get; set; }
    Property Value
    Type Description
    System.Func<Microsoft.AspNetCore.Http.HttpContext, System.String>

    The function delegate that will resolve a unique context of the throttling middleware.

    | Improve this Doc

    Quota

    Gets or sets the allowed quota for a given context.

    Declaration
    public ThrottleQuota Quota { get; set; }
    Property Value
    Type Description
    ThrottleQuota

    The allowed quota for a given context.

    | Improve this Doc

    RateLimitHeaderName

    Gets or sets the name of the rate limit HTTP header.

    Declaration
    public string RateLimitHeaderName { get; set; }
    Property Value
    Type Description
    System.String

    The name of the rate limit HTTP header.

    | Improve this Doc

    RateLimitRemainingHeaderName

    Gets or sets the name of the rate limit remaining HTTP header.

    Declaration
    public string RateLimitRemainingHeaderName { get; set; }
    Property Value
    Type Description
    System.String

    The name of the rate limit remaining HTTP header.

    | Improve this Doc

    RateLimitResetHeaderName

    Gets or sets the name of the rate limit reset HTTP header.

    Declaration
    public string RateLimitResetHeaderName { get; set; }
    Property Value
    Type Description
    System.String

    The name of the rate limit reset HTTP header.

    | Improve this Doc

    ResponseBroker

    Gets or sets the function delegate that configures the response in the form of a System.Net.Http.HttpResponseMessage.

    Declaration
    public Func<TimeSpan, DateTime, HttpResponseMessage> ResponseBroker { get; set; }
    Property Value
    Type Description
    System.Func<System.TimeSpan, System.DateTime, System.Net.Http.HttpResponseMessage>

    The function delegate that configures the response in the form of a System.Net.Http.HttpResponseMessage.

    | Improve this Doc

    RetryAfterHeader

    Gets or sets the preferred Retry-After HTTP header value that conforms with RFC 2616.

    Declaration
    public ThrottlingRetryAfterHeader RetryAfterHeader { get; set; }
    Property Value
    Type Description
    ThrottlingRetryAfterHeader

    The preferred Retry-After HTTP header value that conforms with RFC 2616.

    | Improve this Doc

    TooManyRequestsMessage

    Gets or sets the message of a throttled request that has exceeded the rate limit.

    Declaration
    public string TooManyRequestsMessage { get; set; }
    Property Value
    Type Description
    System.String

    The message of a throttled request that has exceeded the rate limit.

    | Improve this Doc

    UseRetryAfterHeader

    Gets or sets a value indicating whether to include a Retry-After HTTP header specifying how long to wait before making a new request.

    Declaration
    public bool UseRetryAfterHeader { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to include a Retry-After HTTP header specifying how long to wait before making a new request; otherwise, false.

    Extension Methods

    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, DateTime, Action<TimeBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, Func<T, DateTime>, Action<TimeBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, Byte[], Action<ContentBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, Func<T, Byte[]>, Action<ContentBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, DateTime, Byte[], Action<ContentTimeBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, Func<T, DateTime>, Func<T, Byte[]>, Action<ContentTimeBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, DateTime, Func<T, Byte[]>, Action<ContentTimeBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, Func<T, DateTime>, Byte[], Action<ContentTimeBasedOptions>)
    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX