Arcjet · Concept
Interval
Use a Go token bucket to limit how often an operation can run. Set a capacity, refill rate, interval, and trusted key, then stop when the Guard decision is denied.
Last updated
Syntax
arcjet.GuardTokenBucket(arcjet.GuardTokenBucketOptions{Mode: arcjet.ModeLive, RefillRate: 5, Interval: time.Minute, Capacity: 10, Bucket: "api"})
rule.Key(userID, requested)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
GuardTokenBucketGuardTokenBucketOptionsGuardClientGuardRequestGuardRuleInputModeLiveModeDryRunValidateGuardLabel