File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ type ClientConfig struct {
9797
9898 // RetryEligiableRequests when false bypasses any retry logic for a simpler request flow.
9999 RetryEligiableRequests bool `json:"retry_eligiable_requests"`
100+
101+ HTTPExecutor HTTPExecutor
100102}
101103
102104// BuildClient creates a new HTTP client with the provided configuration.
@@ -120,9 +122,7 @@ func (c *ClientConfig) Build() (*Client, error) {
120122
121123 c .Sugar .Debug ("configuration valid" )
122124
123- httpClient := & prodClient {
124- & http.Client {},
125- }
125+ httpClient := c .HTTPExecutor
126126
127127 cookieJar , err := cookiejar .New (nil )
128128 if err != nil {
Original file line number Diff line number Diff line change @@ -29,3 +29,11 @@ func (c *prodClient) Cookies(url *url.URL) []*http.Cookie {
2929func (c * prodClient ) SetRedirectPolicy (policy * func (req * http.Request , via []* http.Request ) error ) {
3030 c .CheckRedirect = * policy
3131}
32+
33+ type testClient struct {
34+ }
35+
36+ func (m * testClient ) Do (req * http.Request ) (* http.Response , error ) {
37+ // do some stuff which makes a response you like
38+ return nil , nil
39+ }
You can’t perform that action at this time.
0 commit comments