MCPcopy Index your code
hub / github.com/cloudfoundry/cli / NewConnection

Function NewConnection

api/cloudcontroller/cloud_controller_connection.go:32–45  ·  view source on GitHub ↗

NewConnection returns a new CloudControllerConnection with provided configuration.

(config Config)

Source from the content-addressed store, hash-verified

30// NewConnection returns a new CloudControllerConnection with provided
31// configuration.
32func 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.
48func (connection *CloudControllerConnection) Make(request *Request, passedResponse *Response) error {

Calls 1

NewTLSConfigFunction · 0.92

Tested by

no test coverage detected