Documentation
¶
Overview ¶
Package throttle keeps the registry clients away from an upstream that asked to wait with a Retry-After header (RFC 9110, section 10.2.3), so a check fails fast instead of calling it again too soon.
Index ¶
Constants ¶
View Source
const MaxWait = time.Hour
MaxWait caps a Retry-After, a choice: an absurd one must not keep an upstream unused until the next restart.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Throttle ¶
type Throttle struct {
// contains filtered or unexported fields
}
Throttle remembers, per host, until when an upstream asked not to be called. It is safe for concurrent use.
func (*Throttle) Allows ¶
Allows reports whether host may be called now, and forgets a wait that is over.
Click to show internal directories.
Click to hide internal directories.