Replace explicit http.Client usage with specific interface - #18
Open
egor-gorlin-exinity wants to merge 3 commits into
Open
Replace explicit http.Client usage with specific interface#18egor-gorlin-exinity wants to merge 3 commits into
egor-gorlin-exinity wants to merge 3 commits into
Conversation
Update CustomAttributes type to correct one.
| APISecret string `json:"apiSecret,omitempty"` | ||
| } | ||
|
|
||
| type RequestDoer interface { |
There was a problem hiding this comment.
Suggested change
| type RequestDoer interface { | |
| type HTTPDoer interface { |
I would recommend naming specific to HTTP since the interface is just in the events package. This will help the developers.
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.
Summary
This PR replaces explicit http.Client usage with narrow and specific interface.
We need to have ability to intercept outgoing http requests to perform verbose logging.
To achieve that we wrap http.Client with our implementation which passes requests through and logs them.
Also fixes typo in unit tests.
Testing Plan
You should be able to replace Configuration.HTTPClient with your own implmentation of RequestDoer interface.
Master Issue
Closes #17