carbond.limiter.ReqPropertyLimiterSelector¶
ReqPropertyLimiterSelector
is used to group
incoming requests by an arbitrary property on those requests (e.g., req.ip
).
Class¶
-
class
carbond.limiter.
LimiterSelector
()¶ - ¶
propertyPath String
Required Description A string representing a property to be resolved as the selector for an incoming request (e.g. “ req.user.username
”).
- ¶
transform Function
Required Description If this is specified, any property resolved by propertyPath
will be passed throughtransform
to generate the appropriate key (useful if the property being resolved is not aString
).
- ¶
hash String
Description hash
evaluates topropertyPath
.
- ¶
key Arguments - req (
request
) – the current request
Returns the key used to group the current request or undefined
if the key could not be generatedReturn type String
Description This resolves the property to be used on req
usingpropertyPath
and, if found, passes it throughtransform
if appropriate before returning it.- req (