Documentation
¶
Overview ¶
Package ratelimit parses server-provided retry pacing without coupling retry loops to one gateway's header names.
Index ¶
Constants ¶
View Source
const ( // HeaderLimit is the Lark OpenAPI gateway's request-window quota. HeaderLimit = "X-Ogw-Ratelimit-Limit" // HeaderReset is the Lark OpenAPI gateway's remaining recovery time in // seconds. It takes precedence over the standard Retry-After fallback. HeaderReset = "X-Ogw-Ratelimit-Reset" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Info ¶
Info is the transport-neutral rate-limit signal extracted from one response.
func ParseHeaders ¶
ParseHeaders reads Lark gateway pacing first, then the standard Retry-After delta-seconds or HTTP-date form. Invalid and non-positive values are ignored.
func ParseStandardHeaders ¶
ParseStandardHeaders reads the standard Retry-After delta-seconds or HTTP-date form.
func (Info) RetryAfterSeconds ¶
RetryAfterSeconds rounds a positive delay up so serialized retry metadata never asks a caller to retry before the server-provided recovery instant.
Click to show internal directories.
Click to hide internal directories.