NewConnection returns a new CloudControllerConnection with provided configuration.
(config Config)
| 30 | // NewConnection returns a new CloudControllerConnection with provided |
| 31 | // configuration. |
| 32 | func NewConnection(config Config) *CloudControllerConnection { |
| 33 | tr := &http.Transport{ |
| 34 | TLSClientConfig: util.NewTLSConfig(nil, config.SkipSSLValidation), |
| 35 | Proxy: http.ProxyFromEnvironment, |
| 36 | DialContext: (&net.Dialer{ |
| 37 | KeepAlive: 30 * time.Second, |
| 38 | Timeout: config.DialTimeout, |
| 39 | }).DialContext, |
| 40 | } |
| 41 | |
| 42 | return &CloudControllerConnection{ |
| 43 | HTTPClient: &http.Client{Transport: tr}, |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | // Make performs the request and parses the response. |
| 48 | func (connection *CloudControllerConnection) Make(request *Request, passedResponse *Response) error { |
no test coverage detected