RateLimiter
Less than 1 minute
RateLimiter
Class RateLimiter.
This class is responsible for rate limiting HTTP requests.
Properties
backend
private Backend $backend
windowLength
private int $windowLength
requestLimit
private int $requestLimit
requestMinimumPeriod
private int $requestMinimumPeriod
headers
private array $headers
Methods
__construct
RateLimiter constructor.
public __construct({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$options | array | the options for the rate limiter |
$backend | Backend | the backend to use for the rate limiter |
getInfo
Retrieves information about a specific identifier.
public getInfo({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$identifier | string | the identifier to retrieve information for |
check
Checks if the given identifier is allowed to proceed based on rate limiting rules.
public check({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$identifier | string | the identifier to check |
delete
Deletes a rate limiter entry identified by the given identifier.
public delete({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$identifier | string | the identifier of the rate limiter entry to delete |
getHeaders
Retrieves the headers for the specified identifier.
public getHeaders({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$identifier | string | the identifier for the headers |
getLastRequestTime
public getLastRequestTime({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$identifier | string |
Generated by Hazaar API Doc Generator