Свойство | Тип | Описание | |
---|---|---|---|
$cache | Illuminate\Cache\CacheManager | Cache instance. | |
$container | Illuminate\Container\Container | Container instance. | |
$keyPrefix | string | The key prefix used when throttling route specific requests. | |
$limiter | callback | A callback used to define the limiter. | |
$request | Dingo\Api\Http\Request | Request instance being throttled. | |
$throttle | Dingo\Api\Contract\Http\RateLimit\Throttle | Throttle used for rate limiting. | |
$throttles | Registered throttles. |
Метод | Описание | |
---|---|---|
__construct ( Illuminate\Container\Container $container, Illuminate\Cache\CacheManager $cache, array $throttles ) : void | Create a new rate limit handler instance. | |
exceededRateLimit ( ) : boolean | Determine if the rate limit has been exceeded. | |
extend ( callable | Dingo\Api\Http\RateLimit\Throttle $throttle ) : void | Extend the rate limiter by adding a new throttle. | |
getRateLimitReset ( ) : integer | Get the timestamp for when the current rate limiting will expire. | |
getRateLimiter ( ) : string | Get the rate limiter. | |
getRemainingLimit ( ) : integer | Get the remaining limit before the consumer is rate limited. | |
getThrottle ( ) : Dingo\Api\Contract\Http\RateLimit\Throttle | Get the throttle used to rate limit the request. | |
getThrottleLimit ( ) : integer | Get the limit of the throttle used. | |
rateLimitRequest ( Dingo\Api\Http\Request $request, integer $limit, integer $expires ) : void | Execute the rate limiting for the given request. | |
requestWasRateLimited ( ) : boolean | Determine if the request was rate limited. | |
setRateLimiter ( callable $limiter ) : void | Set the rate limiter. | |
setThrottle ( string | Dingo\Api\Contract\Http\RateLimit\Throttle $throttle ) : void | Set the throttle to use for rate limiting. |
Метод | Описание | |
---|---|---|
cache ( string $key, mixed $value, integer $minutes ) : void | Cache a value under a given key for a certain amount of minutes. | |
forget ( string $key ) : void | Forget a key in the cache. | |
getMatchingThrottles ( ) : |
Get matching throttles after executing the condition of each throttle. | |
increment ( string $key ) : void | Increment a key in the cache. | |
key ( string $key ) : string | Namespace a cache key. | |
prepareCacheStore ( ) : void | Prepare the cache store. | |
retrieve ( string $key ) : mixed | Retrieve a value from the cache store. |
public __construct ( Illuminate\Container\Container $container, Illuminate\Cache\CacheManager $cache, array $throttles ) : void | ||
$container | Illuminate\Container\Container | |
$cache | Illuminate\Cache\CacheManager | |
$throttles | array | |
Результат | void |
public exceededRateLimit ( ) : boolean | ||
Результат | boolean |
protected getMatchingThrottles ( ) : |
||
Результат |
public getRateLimitReset ( ) : integer | ||
Результат | integer |
public getRateLimiter ( ) : string | ||
Результат | string |
public getRemainingLimit ( ) : integer | ||
Результат | integer |
public getThrottle ( ) : Dingo\Api\Contract\Http\RateLimit\Throttle | ||
Результат | Dingo\Api\Contract\Http\RateLimit\Throttle |
public getThrottleLimit ( ) : integer | ||
Результат | integer |
protected prepareCacheStore ( ) : void | ||
Результат | void |
public requestWasRateLimited ( ) : boolean | ||
Результат | boolean |
public setRateLimiter ( callable $limiter ) : void | ||
$limiter | callable | |
Результат | void |
public setThrottle ( string | Dingo\Api\Contract\Http\RateLimit\Throttle $throttle ) : void | ||
$throttle | string | Dingo\Api\Contract\Http\RateLimit\Throttle | |
Результат | void |
protected CacheManager,Illuminate\Cache $cache | ||
Результат | Illuminate\Cache\CacheManager |
protected Container,Illuminate\Container $container | ||
Результат | Illuminate\Container\Container |
protected string $keyPrefix | ||
Результат | string |
protected callback $limiter | ||
Результат | callback |
protected Request,Dingo\Api\Http $request | ||
Результат | Dingo\Api\Http\Request |
protected Throttle,Dingo\Api\Contract\Http\RateLimit $throttle | ||
Результат | Dingo\Api\Contract\Http\RateLimit\Throttle |