Skip to content

Commit 1d1eaec

Browse files
committed
feat: add option to set custom http.Client on HTTPRequester
1 parent 4313a44 commit 1d1eaec

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/utils/requester.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ type Header struct {
5050
Name, Value string
5151
}
5252

53+
// Client sets http client
54+
func Client(client http.Client) func(r *HTTPRequester) {
55+
return func(r *HTTPRequester) {
56+
r.client = client
57+
}
58+
}
59+
5360
// Timeout sets http client timeout
5461
func Timeout(timeout time.Duration) func(r *HTTPRequester) {
5562
return func(r *HTTPRequester) {

0 commit comments

Comments
 (0)