package
0.0.0-20240208133358-b46fc268ba2c
Repository: https://github.com/diptanw/go-toolkit.git
Documentation: pkg.go.dev
# Functions
DefaultPolicy is default retry policy configuration.
ExponentialBackoff is a callback for exponential backoff based on the attempt number and limited by the provided min and max durations.
HTTPCheck is the policy callback, which will retry on connection errors and certain server responses.
NewHTTPClient returns a new http.Client with the http.DefaultTransport wrapped with retrialable round tripper.
WithPolicy returns a copy of http.Client with retrialable transport.
# Type aliases
Backoff is a func that defines the amount of time to wait between retries.
Callback accepts the boolean 'retrying' variable for the optional logical extension on the callback side.
Check is a func that defines a policy for processing retries, it is based on a given error and optional result associated with it.