Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RateLimitBuiltin = &ast.Builtin{ Name: "rate_limit", Decl: types.NewFunction(types.Args(types.A), types.B), }
View Source
var UpdateLimitsUsageBuiltin = &ast.Builtin{ Name: "update_limits_usage", Decl: types.NewFunction(types.Args(), types.B), }
Functions ¶
func RateLimitBuiltinImpl ¶
Returns true if limited, false otherwise. It does not update the counter used to rate-limit. Instead, when within limits, the increase value is stored in the context so it can be applied later. When rate-limited, it cleans the limits in the context, because in that case, we want to make sure that no updates are applied.
func UpdateLimitsUsageBuiltinImpl ¶
func UpdateLimitsUsageBuiltinImpl(bctx topdown.BuiltinContext) (ast.Value, error)
Updates the counters used to rate-limit with the values stored in the context.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.