This PR changes default v2 HTTP client to go-retryablehttp.
This new library provides retry logic for HTTP server errors and network errors.
Debug logs for retries can be seen when running unit tests:
=== RUN TestDefaultClient_Retry
2022/09/05 14:03:38 [DEBUG] GET http://127.0.0.1:42175
2022/09/05 14:03:38 [DEBUG] GET http://127.0.0.1:42175 (status: 500): retrying in 1s (4 left)
2022/09/05 14:03:39 [DEBUG] GET http://127.0.0.1:42175 (status: 500): retrying in 2s (3 left)
--- PASS: TestDefaultClient_Retry (3.00s)
Because user-agent setter was implemented as http Transport (and would overwrite the new library logic), user-agent setter now works as oapi request editor.
This PR changes default v2 HTTP client to go-retryablehttp. This new library provides retry logic for HTTP server errors and network errors.
Debug logs for retries can be seen when running unit tests:
Because user-agent setter was implemented as http Transport (and would overwrite the new library logic), user-agent setter now works as oapi request editor.