Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Client ¶ added in v4.4.0
func Client(next http.RoundTripper, cl *jwt.Claims, cfg *config.Config) (c *http.Client, authed bool, err error)
Client returns an http.Client configured according to the supplied configuration.
If nil is passed for a claim, the returned client does no signing.
It returns an *http.Client and a boolean indicating whether the client is configured for authentication, or an error that occurred during construction.
func RateLimiter ¶
func RateLimiter(next http.RoundTripper) http.RoundTripper
RateLimiter wraps the provided RoundTripper with a limiter allowing 10 requests/second/host.
It responds to HTTP 429 responses by automatically decreasing the rate.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.