package
1.7.0
Repository: https://github.com/acronis/go-appkit.git
Documentation: pkg.go.dev

# Functions

CheckErrorIsTemporary checks either error is temporary or not.
DefaultCheckRetry represents default function to determine either retry is needed or not.
GetRequestTypeFromContext extracts request type from the context.
MustNew wraps delegate transports with logging, rate limiting, retryable, request id and panics if any error occurs.
MustNewWithOpts wraps delegate transports with options logging, metrics, rate limiting, retryable, user agent, request id and panics if any error occurs.
New wraps delegate transports with logging, rate limiting, retryable, request id and returns an error if any occurs.
NewAuthBearerRoundTripper creates a new AuthBearerRoundTripper.
NewAuthBearerRoundTripperWithOpts creates a new AuthBearerRoundTripper with options.
NewConfig creates a new instance of the Config.
NewConfigWithKeyPrefix creates a new instance of the Config.
NewContextWithRequestType creates a new context with request type.
NewLoggingRoundTripper creates an HTTP transport that log requests.
NewLoggingRoundTripperWithOpts creates an HTTP transport that log requests with options.
NewMetricsRoundTripper creates an HTTP transport that measures requests done.
NewMetricsRoundTripperWithOpts creates an HTTP transport that measures requests done.
NewPrometheusMetricsCollector creates a new Prometheus metrics collector.
NewRateLimitingRoundTripper creates a new RateLimitingRoundTripper with specified rate limit.
NewRateLimitingRoundTripperWithOpts creates a new RateLimitingRoundTripper with specified rate limit and options.
NewRequestIDRoundTripper creates an HTTP transport with X-Request-ID header support.
NewRequestIDRoundTripperWithOpts creates an HTTP transport with X-Request-ID header support with options.
NewRetryableRoundTripper returns a new instance of RetryableRoundTripper.
NewRetryableRoundTripperWithOpts creates a new instance of RateLimitingRoundTripper with specified options.
NewUserAgentRoundTripper creates a new UserAgentRoundTripper.
NewUserAgentRoundTripperWithOpts creates a new UserAgentRoundTripper with specified options.
NewWithOpts wraps delegate transports with options logging, metrics, rate limiting, retryable, user agent, request id and returns an error if any occurs.

# Constants

DefaultClientWaitTimeout is a default timeout for a client to wait for a request.
Default parameter values for RetryableRoundTripper.
Default parameter values for RetryableRoundTripper.
Default parameter values for RetryableRoundTripper.
Default parameter values for RateLimitingRoundTripper.
Default parameter values for RateLimitingRoundTripper.
No description provided by the author
No description provided by the author
RetryAttemptNumberHeader is an HTTP header name that will contain the serial number of the retry attempt.
RetryPolicyConstant is a policy for constant retries.
RetryPolicyExponential is a policy for exponential retries.
UnlimitedRetryAttempts should be used as RetryableRoundTripperOpts.MaxRetryAttempts value when we want to stop retries only by RetryableRoundTripperOpts.BackoffPolicy.
User-Agent update strategies.
User-Agent update strategies.
User-Agent update strategies.

# Variables

DefaultBackoffPolicy is a default backoff policy.

# Structs

AuthBearerRoundTripper implements http.RoundTripper interface and sets Authorization HTTP header in all outgoing requests.
AuthBearerRoundTripperError is returned in RoundTrip method of AuthBearerRoundTripper when the original request cannot be potentially retried.
AuthBearerRoundTripperOpts is options for AuthBearerRoundTripper.
Config represents options for HTTP client configuration.
ConstantBackoffConfig represents configuration options for constant backoff.
ExponentialBackoffConfig represents configuration options for exponential backoff.
LogConfig represents configuration options for HTTP client logs.
LoggingRoundTripper implements http.RoundTripper for logging requests.
LoggingRoundTripperOpts represents an options for LoggingRoundTripper.
MetricsConfig represents configuration options for HTTP client logs.
MetricsRoundTripper is an HTTP transport that measures requests done.
MetricsRoundTripperOpts is an HTTP transport that measures requests done.
Opts provides options for NewWithOpts and MustWithOpts functions.
PrometheusMetricsCollector is a Prometheus metrics collector.
RateLimitingRoundTripper wraps implementing http.RoundTripper interface object and provides adaptive (can use limit from response's HTTP header) rate limiting mechanism for outgoing requests.
RateLimitingRoundTripperAdaptation represents a params to adapt rate limiting in accordance with value in response.
RateLimitingRoundTripperOpts represents an options for RateLimitingRoundTripper.
RateLimitingWaitError is returned in RoundTrip method of RateLimitingRoundTripper when rate limit is exceeded.
RateLimitsConfig represents configuration options for HTTP client rate limits.
RequestIDRoundTripper for X-Request-ID header to the request.
RequestIDRoundTripperOpts for X-Request-ID header to the request options.
RetriesConfig represents configuration options for HTTP client retries policy.
RetryableRoundTripper wraps an object that implements http.RoundTripper interface and provides a retrying mechanism for HTTP requests.
RetryableRoundTripperError is returned in RoundTrip method of RetryableRoundTripper when the original request cannot be potentially retried.
RetryableRoundTripperOpts represents an options for RetryableRoundTripper.
UserAgentRoundTripper implements http.RoundTripper interface and sets User-Agent HTTP header in all outgoing requests.
UserAgentRoundTripperOpts represents an options for UserAgentRoundTripper.

# Interfaces

AuthProvider provide auth information that used for barear authrization.
MetricsCollector is an interface for collecting metrics for client requests.

# Type aliases

CheckRetryFunc is a function that is called right after RoundTrip() method and determines if the next retry attempt is needed.
LoggingMode represents a mode of logging.
RetryPolicy represents a retry policy strategy.
UserAgentUpdateStrategy represents a strategy for updating User-Agent HTTP header.