Skip to content

Commit

Permalink
feat: allow overriding the httpClient (#7)
Browse files Browse the repository at this point in the history
This allows you to plug in retryablehttp

Signed-off-by: Duane May <[email protected]>
  • Loading branch information
duanemay authored Jun 30, 2023
1 parent c635fbf commit 1e31786
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,3 +353,11 @@ func WithMTLS(caCertFile string, clientCertFile string, clientKeyFile string) Cl
return errors.New("could not set tls options")
}
}

// WithHttpClient overrides the default HttpClient.
func WithHttpClient(client *http.Client) ClientOption {
return func(c *Client) error {
c.httpClient = client
return nil
}
}

0 comments on commit 1e31786

Please sign in to comment.