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 StringRequired Description A string representing a property to be resolved as the selector for an incoming request (e.g. “ req.user.username”).
- ¶
transform FunctionRequired Description If this is specified, any property resolved by propertyPathwill be passed throughtransformto generate the appropriate key (useful if the property being resolved is not aString).
- ¶
hash StringDescription hashevaluates topropertyPath.
- ¶
key Arguments - req (
request) – the current request
Returns the key used to group the current request or undefinedif the key could not be generatedReturn type StringDescription This resolves the property to be used on requsingpropertyPathand, if found, passes it throughtransformif appropriate before returning it.- req (