blob: 5a8dd9d258ee2ada4e2b26a2b4349bd9ebb9e329 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
package gitlabclient
import (
"net/http"
"time"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/config"
)
type Client struct {
config *config.Config
httpClient *http.Client
}
type DiscoverResponse struct {
}
func New() (*Client, error) {
config, err := config.New()
if err != nil {
return nil, err
}
tr := &http.Transport{
MaxIdleConns: 10,
IdleConnTimeout: 30 * time.Second,
DisableCompression: true,
}
httpClient := &http.Client{Transport: tr}
return &Client{config: config, httpClient: httpClient}, nil
}
|