consumeRateLimit(Defined in: packages/modelence/src/rate-limit/rules.ts:30 This function will check all rate limit rules on the specified bucket and type, throw an error if any of them are exceeded and increase the count of the rate limit record.options):Promise<void>
Example
Parameters
| Parameter | Type | Description |
|---|---|---|
options | { bucket: string; message?: string; type: RateLimitType; value: string; } | - |
options.bucket | string | The bucket for the rate limit. |
options.message? | string | Optional custom error message when the rate limit is exceeded. |
options.type | RateLimitType | The type of the rate limit. |
options.value | string | The value for the rate limit. |
Returns
Promise<void>