Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶ added in v4.6.0
NewClient constructs an http.Client that disallows access to public networks, controlled by the localOnly flag.
If disallowed, the reported error will be a *net.AddrError with the "Err" value of "disallowed by policy".
func NewRequestWithContext ¶ added in v4.6.0
func NewRequestWithContext(ctx context.Context, method, url string, body io.Reader) (*http.Request, error)
NewRequestWithContext is a wrapper around http.NewRequestWithContext that sets some defaults in the returned request.
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 ¶
type Signer ¶ added in v4.6.0
type Signer struct {
// contains filtered or unexported fields
}
Signer signs requests.
func NewSigner ¶ added in v4.6.0
NewSigner constructs a signer according to the provided Config and claim.
The returned Signer only adds headers for the hosts specified in the following spots:
- $.notifier.webhook.target
- $.notifier.indexer_addr
- $.notifier.matcher_addr
- $.matcher.indexer_addr