コード例 #1
0
 public DistributedCacheClientPolicyStore(
     IDistributedCache cache,
     IOptions <ClientRateLimitOptions> options   = null,
     IOptions <ClientRateLimitPolicies> policies = null) : base(cache)
 {
     _options  = options?.Value;
     _policies = policies?.Value;
 }
コード例 #2
0
 public RedisCacheClientPolicyStore(
     IConnectionMultiplexer redis,
     IOptions <ClientRateLimitOptions> options   = null,
     IOptions <ClientRateLimitPolicies> policies = null) : base(redis)
 {
     _options  = options?.Value;
     _policies = policies?.Value;
 }
コード例 #3
0
        public ClientRateLimitProcessor(ClientRateLimitOptions options,
                                        IRateLimitCounterStore counterStore,
                                        IClientPolicyStore policyStore)
        {
            _options      = options;
            _counterStore = counterStore;
            _policyStore  = policyStore;

            _core = new RateLimitCore(false, options, _counterStore);
        }
コード例 #4
0
 public ClientRateLimitProcessor(
     ClientRateLimitOptions options,
     IRateLimitCounterStore counterStore,
     IClientPolicyStore policyStore,
     IRateLimitConfiguration config)
     : base(options, counterStore, new ClientCounterKeyBuilder(options), config)
 {
     _options     = options;
     _policyStore = policyStore;
 }
コード例 #5
0
 public ClientRateLimitProcessor(
     ClientRateLimitOptions options,
     IClientPolicyStore policyStore,
     IProcessingStrategy processingStrategy)
     : base(options)
 {
     _options            = options;
     _policyStore        = policyStore;
     _counterKeyBuilder  = new ClientCounterKeyBuilder(options);
     _processingStrategy = processingStrategy;
 }
コード例 #6
0
 public ClientRateLimitMiddleware(RequestDelegate next,
                                  IOptions <ClientRateLimitOptions> options,
                                  IRateLimitCounterStore counterStore,
                                  IClientPolicyStore policyStore,
                                  ILogger <ClientRateLimitMiddleware> logger
                                  )
 {
     _next      = next;
     _options   = options.Value;
     _logger    = logger;
     _processor = new ClientRateLimitProcessor(_options, counterStore, policyStore);
 }