Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPClient ¶
func NewHTTPClient() *retryablehttp.Client
NewHTTPClient returns a retryable HTTP client
Types ¶
type HTTPLogAdaptor ¶
type HTTPLogAdaptor struct{}
HTTPLogAdaptor adapts the retryablehttp.Logger interface to the go-utils logger.
func (*HTTPLogAdaptor) Printf ¶
func (*HTTPLogAdaptor) Printf(fmtStr string, vars ...interface{})
Printf implements the retryablehttp.Logger interface
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model ...
func (Model) Try ¶
Try continues executing the supplied action while this action parameter returns an error and the configured number of times has not been reached. Otherwise, it stops and returns the last received error.
func (Model) TryWithAbort ¶
func (Model Model) TryWithAbort(action AbortableAction) error
TryWithAbort continues executing the supplied action while this action parameter returns an error, a false bool value and the configured number of times has not been reached. Returning a true value from the action aborts the retry loop.
Good for retrying actions which can return a mix of retryable and non-retryable failures.