Raydium Framework

RateLimiter
in package

Table of Contents

$hardLimit  : int
$redis  : Client
$softLimit  : int
$window  : int
__construct()  : mixed
hit()  : float
Register a hit, return risk score 0-1 (0 none, 1 definitely brute).
penalize()  : void
setLimit()  : self
setRedis()  : self

Properties

Methods

__construct()

public __construct(Client $redis[, int $window = 900 ][, int $softLimit = 3 ][, int $hardLimit = 10 ]) : mixed
Parameters
$redis : Client
$window : int = 900
$softLimit : int = 3
$hardLimit : int = 10
Return values
mixed

hit()

Register a hit, return risk score 0-1 (0 none, 1 definitely brute).

public hit(string $key) : float
Parameters
$key : string
Return values
float

penalize()

public penalize(string $key, int $ttl) : void
Parameters
$key : string
$ttl : int
Return values
void

setLimit()

public setLimit(array<string|int, mixed> $limit) : self
Parameters
$limit : array<string|int, mixed>
Return values
self

setRedis()

public setRedis(array<string|int, mixed> $connection) : self
Parameters
$connection : array<string|int, mixed>
Return values
self

Search results