Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interceptor ¶
func Log ¶
func Log(logger interface {
Debugf(string, ...interface{})
Errorf(string, ...interface{})
}) Interceptor
func New ¶
func New(interceptors ...Interceptor) Interceptor
func Retry ¶
func Retry(tries int) Interceptor
Retry request interceptor, call `Retry(0)` means make a single call with no retry.
func UntilStatusCodeIs ¶
func UntilStatusCodeIs(status int) Interceptor
UntilStatusCodeIs returns an error until specified response status code is received.
func WhileFails ¶
func WhileFails(checkFunc func(*http.Response) error) Interceptor
WhileFails is one of the configurable parts of retry strategy. Specify the function to check the response and return descriptive error message if needed.
func WithInterval ¶
func WithInterval(duration time.Duration) Interceptor
func (Interceptor) Then ¶
func (icp Interceptor) Then(doer Doer) Doer
func (Interceptor) Use ¶
func (icp Interceptor) Use(interceptors ...Interceptor) Interceptor
Click to show internal directories.
Click to hide internal directories.