Closed Nightapes closed 4 years ago
I've applied the changes similar to described above and docs are updated.
Thank you for the contribution, I've release v0.2.0 which contains a combination of your changes and my updates applied.
@alexejk i like the idea with the options, great job! Thanks for the fast release
Thanks for the PR, @Nightapes ! I'm a bit concerned about adding another argument to
NewClientXXX
functions as this is probably not the best approach for each and every customization option that might need to happen. I would rather opt in for mutating the client with help of Options functions.Something in the style of the following:
Something like described here: https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis
This would mean we won't need
NewClientWithHttpClient
either, and that potentially can be removed in favor offunc HttpClientOption(hc *http.Client) Option{}
.What are your thoughts on the above?