Beispiel #1
0
        public UserRateLimitProcessor(UserRateLimitOptions options,
                                      IRateLimitCounterStore counterStore,
                                      IUserPolicyStore policyStore)
        {
            _options      = options;
            _counterStore = counterStore;
            _policyStore  = policyStore;

            _core = new RateLimitCore(false, options, _counterStore);
        }
Beispiel #2
0
        public UserRateimiterMiddleWare(RequestDelegate next,
                                        IOptions <UserRateLimitOptions> options,
                                        IRateLimitCounterStore counterStore,
                                        IUserPolicyStore policyStore,
                                        ILogger <UserRateimiterMiddleWare> logger
                                        )
        {
            _next    = next;
            _logger  = logger;
            _options = options.Value;

            _processor = new UserRateLimitProcessor(_options, counterStore, policyStore);
        }
 public UserRateLimitRuntimeController(IOptions <UserRateLimitOptions> optionsAccessor, IUserPolicyStore userPolicyStore)
 {
     _options         = optionsAccessor.Value;
     _userPolicyStore = userPolicyStore;
 }