Documentation ¶
Index ¶
- func DoHTTPWithRetry(attempts int, sleeptime time.Duration, request *http.Request) (*http.Response, error)
- func GetHTTPClient() *http.Client
- func GetHTTPClientWithConfig(httpTransport HTTPTransport) *http.Client
- func TryAttempts(client *http.Client, request *http.Request, resp *http.Response, err error, ...) (*http.Response, error)
- func TryAttemptsWithRequestBody(client *http.Client, request *http.Request, resp *http.Response, err error, ...) (*http.Response, error)
- type HTTPTransport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoHTTPWithRetry ¶
func DoHTTPWithRetry(attempts int, sleeptime time.Duration, request *http.Request) (*http.Response, error)
DoHTTPWithRetry for retry support to http request
func GetHTTPClient ¶
GetHTTPClient This method will return the httpClient object with preconfigured settings
func GetHTTPClientWithConfig ¶
func GetHTTPClientWithConfig(httpTransport HTTPTransport) *http.Client
GetHTTPClientWithConfig This method will return the httpClient object with preconfigured settings
func TryAttempts ¶
func TryAttempts(client *http.Client, request *http.Request, resp *http.Response, err error, attempts int, sleeptime time.Duration) (*http.Response, error)
TryAttempts it retries http get/post request without request body
func TryAttemptsWithRequestBody ¶
func TryAttemptsWithRequestBody(client *http.Client, request *http.Request, resp *http.Response, err error, attempts int, sleeptime time.Duration, bodyBytes []byte) (*http.Response, error)
TryAttemptsWithRequestBody it retries http post request with a request body when failed or gives error
Types ¶
Click to show internal directories.
Click to hide internal directories.