Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
Middleware returns a gentleman plugin implementing retry logic for http requests implementing http round tripper interface.
Types ¶
type Option ¶
type Option func(*transport)
func BackoffTimeout ¶
BackoffTimeout returns an option setting the transports backoff timeout between retries to the given duration.
func Evaluator ¶
func Evaluator(evalFn evalFunc) Option
Evaluator returns an option containing an evaluator function capable of deciding whether a new retry is needed.
If not set the defaultEvaluator will be used. If the request has resulted in an error, or the request status code indicates a server problem, or the request timed out, the default evaluator returns that a retry is needed.
func LogRequest ¶
func LogRequest() Option
LogRequest returns an option which will enable the logging of requests using httputil.DumpResponse.
func LogResponse ¶
func LogResponse() Option
LogResponse returns an option which will enable the logging of responses using httputil.DumpResponse.
func RequestTimeout ¶
RequestTimeout returns an option setting the transport request timeout to the given duration.
If the original request had a deadline, than it will be used mainly. Without a deadline on the original request the given timeout is set per retry for the request.