httputil

package
v4.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL