We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1523907 + 8abb720 commit 1fa9f5fCopy full SHA for 1fa9f5f
pkg/codefresh/codefresh.go
@@ -24,11 +24,15 @@ type (
24
)
25
26
func New(opt *ClientOptions) Codefresh {
27
+ httpClient := &http.Client{}
28
+ if opt.Client != nil {
29
+ httpClient = opt.Client
30
+ }
31
32
return &codefresh{
33
host: opt.Host,
34
token: opt.Auth.Token,
- client: &http.Client{},
35
+ client: httpClient,
36
}
37
38
pkg/codefresh/types.go
@@ -12,9 +12,10 @@ type (
12
13
// Options
14
ClientOptions struct {
15
- Auth AuthOptions
16
- Debug bool
17
- Host string
+ Auth AuthOptions
+ Debug bool
+ Host string
18
+ Client *http.Client
19
20
21
codefresh struct {
0 commit comments