Property | Type | Description | |
---|---|---|---|
$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. |
Method | Description | |
---|---|---|
__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. |
Method | Description | |
---|---|---|
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 | |
return | void |
public exceededRateLimit ( ) : boolean | ||
return | boolean |
protected getMatchingThrottles ( ) : |
||
return |
public getRateLimitReset ( ) : integer | ||
return | integer |
public getRateLimiter ( ) : string | ||
return | string |
public getRemainingLimit ( ) : integer | ||
return | integer |
public getThrottle ( ) : Dingo\Api\Contract\Http\RateLimit\Throttle | ||
return | Dingo\Api\Contract\Http\RateLimit\Throttle |
public getThrottleLimit ( ) : integer | ||
return | integer |
protected prepareCacheStore ( ) : void | ||
return | void |
public requestWasRateLimited ( ) : boolean | ||
return | boolean |
public setRateLimiter ( callable $limiter ) : void | ||
$limiter | callable | |
return | void |
public setThrottle ( string | Dingo\Api\Contract\Http\RateLimit\Throttle $throttle ) : void | ||
$throttle | string | Dingo\Api\Contract\Http\RateLimit\Throttle | |
return | void |
protected CacheManager,Illuminate\Cache $cache | ||
return | Illuminate\Cache\CacheManager |
protected Container,Illuminate\Container $container | ||
return | Illuminate\Container\Container |
protected string $keyPrefix | ||
return | string |
protected callback $limiter | ||
return | callback |
protected Request,Dingo\Api\Http $request | ||
return | Dingo\Api\Http\Request |
protected Throttle,Dingo\Api\Contract\Http\RateLimit $throttle | ||
return | Dingo\Api\Contract\Http\RateLimit\Throttle |