package
1.73.0
Repository: https://github.com/arm-software/golang-utils.git
Documentation: pkg.go.dev

# Packages

* Copyright (C) 2020-2022 Arm Limited or its affiliates and Contributors.

# Functions

BackOffPolicyFactory generates a backoff policy based on configuration.
DefaultBasicRetryPolicyConfiguration defines a configuration for basic retries i.e.
DefaultExponentialBackoffRetryPolicyConfiguration defines a configuration for retries with exponential backoff.
DefaultHTTPClientConfiguration uses default values similar to https://github.com/hashicorp/go-cleanhttp/blob/6d9e2ac5d828e5f8594b97f88c4bde14a67bb6d2/cleanhttp.go#L23 Similar default values to http.DefaultTransport.
DefaultLinearBackoffRetryPolicyConfiguration defines a configuration for retries with linear backoff.
DefaultNoRetryPolicyConfiguration defines a configuration for no retry being performed.
DefaultRobustHTTPClientConfiguration is similar to DefaultHTTPClientConfiguration but performs basic retry policy on failure.
DefaultRobustHTTPClientConfigurationWithExponentialBackOff is similar to DefaultHTTPClientConfiguration but performs exponential backoff.
DefaultRobustHTTPClientConfigurationWithLinearBackOff is similar to DefaultHTTPClientConfiguration but performs linear backoff.
DefaultRobustHTTPClientConfigurationWithRetryAfter is similar to DefaultRobustHTTPClientConfiguration but considers `Retry-After` header.
DefaultRobustRetryPolicyConfiguration defines a configuration for basic retries but considering any `Retry-After` being returned by server.
FastHTTPClientConfiguration uses parameter values similar to https://github.com/valyala/fasthttp/blob/81fc96827033a5ee92d8a098ab1cdb9827e1eb8d/client.go the configuration was designed for some high performance edge cases: handle thousands of small to medium requests per seconds and a consistent low millisecond response time.
NewBasicRetryPolicy creates a BasicRetryPolicy.
NewConfigurableRetryableClient creates a new http client which will retry failed requests according to the retry configuration (e.g.
NewConfigurableRetryableClientFromClient creates a new http client which will retry failed requests according to the retry configuration (e.g.
NewConfigurableRetryableClientWithLogger creates a new http client which will retry failed requests according to the retry configuration (e.g.
NewConfigurableRetryableClientWithLoggerFromClient creates a new http client which will retry failed requests according to the retry configuration (e.g.
NewConfigurableRetryableOauthClient creates a new http client which will retry failed requests according to the retry configuration (e.g.
NewConfigurableRetryableOauthClientWithLogger creates a new http client which will retry failed requests according to the retry configuration (e.g.
NewConfigurableRetryableOauthClientWithLogger creates a new http client which will retry failed requests according to the retry configuration (e.g.
NewConfigurableRetryableOauthClientWithToken creates a new http client with an authorisation token which will retry based on the configuration.
NewConfigurableRetryableOauthClientWithToken creates a new http client with an authorisation token which will retry based on the configuration.
NewDefaultPooledClient returns a new HTTP client with similar default values to http.Client, but with a shared Transport.
NewExponentialBackoffPolicy creates a ExponentialBackoffPolicy.
NewFastPooledClient returns a new HTTP client with similar default values to fast http client https://github.com/valyala/fasthttp.
NewGenericClient returns a new HTTP client (GenericClient) based on a standard library client implementation.
NewLinearBackoffPolicy creates a LinearBackoffPolicy.
NewPlainHTTPClient creates an HTTP client similar to http.DefaultClient but with extended methods and no shared state.
NewPooledClient returns a new HTTP client using the configuration passed as argument.
NewRetryableClient creates a new http client which will retry failed requests with exponential backoff.
NewRetryableOauthClient creates a new http client with an authorisation token which will retry failed requests with exponential backoff.
NewRetryableOauthClientWithToken creates a new http client with an authorisation token which will retry failed requests with exponential backoff.
NewRetryWaitPolicy creates an generic RetryWaitPolicy based on configuration.
RetryOnError allows the caller to retry fn when the error returned by fn is retriable as in of the type specified by retriableErr.

# Structs

BasicRetryPolicy defines a basic retry policy i.e.
ExponentialBackoffPolicy defines an exponential backoff retry policy.
GenericClient is an HTTP client similar to http.Client (in fact, entirely based on it), but with extended capabilities (e.g.
HTTPClientConfiguration defines the client configuration.
LinearBackoffPolicy defines a linear backoff retry policy based on the attempt number and with jitter to prevent a thundering herd.
PooledClient is an HTTP client similar to http.Client, but with a shared Transport and different configuration values.
RetryableClient is an http client which will retry failed requests according to the retry configuration.
RetryWaitPolicy defines an `abstract` retry wait policy.

# Interfaces

IClient defines an HTTP client similar to http.Client but without shared state with other clients used in the same program.
IRetryableClient is a retryable client.
IRetryWaitPolicy defines the policy which specifies how much wait/sleep should happen between retry attempts.

# Type aliases

RetryPolicyConfiguration was moved to the `retry` module.