Merged
Conversation
erezrokah
commented
Mar 28, 2024
| @@ -48,6 +49,7 @@ type ClientOption func(*Client) error | |||
|
|
|||
| // Creates a new Client, with reasonable defaults | |||
| func NewClient(server string, opts ...ClientOption) (*Client, error) { | |||
Member
Author
There was a problem hiding this comment.
There's also NewClientWithResponses but it wraps the call to NewClient
erezrokah
commented
Mar 28, 2024
|
|
||
| // Creates a new Client, with reasonable defaults | ||
| func NewClient(server string, opts ...ClientOption) (*Client, error) { | ||
| opts = append([]ClientOption{WithHTTPClient(retryablehttp.NewClient().StandardClient())}, opts...) |
Member
Author
There was a problem hiding this comment.
I'm prepending the option to allow consumers override it
hermanschaaf
approved these changes
Mar 28, 2024
Contributor
hermanschaaf
left a comment
There was a problem hiding this comment.
Bit complicated 🙃 ... hopefully we can find a simpler way to do this in the future
Member
Author
Yeah I could add |
kodiakhq bot
pushed a commit
that referenced
this pull request
Mar 28, 2024
🤖 I have created a release *beep* *boop* --- ## [1.9.0](v1.8.1...v1.9.0) (2024-03-28) ### Features * Add retry to API requests ([#141](#141)) ([bf7b4e6](bf7b4e6)) ### Bug Fixes * Generate CloudQuery Go API Client from `spec.json` ([#139](#139)) ([0eb7391](0eb7391)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Looks like this is the only way to inject the retry client, there's also oapi-codegen/oapi-codegen#150 which is in progress via oapi-codegen/oapi-codegen#156