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

Function NewConnection

api/plugin/plugin_connection.go:25–38  ·  view source on GitHub ↗

NewConnection returns a new PluginConnection

(skipSSLValidation bool, dialTimeout time.Duration)

Source from the content-addressed store, hash-verified

23
24// NewConnection returns a new PluginConnection
25func NewConnection(skipSSLValidation bool, dialTimeout time.Duration) *PluginConnection {
26 tr := &http.Transport{
27 TLSClientConfig: util.NewTLSConfig(nil, skipSSLValidation),
28 Proxy: http.ProxyFromEnvironment,
29 DialContext: (&net.Dialer{
30 KeepAlive: 30 * time.Second,
31 Timeout: dialTimeout,
32 }).DialContext,
33 }
34
35 return &PluginConnection{
36 HTTPClient: &http.Client{Transport: tr},
37 }
38}
39
40// Make performs the request and parses the response.
41func (connection *PluginConnection) Make(request *http.Request, passedResponse *Response, proxyReader ProxyReader) error {

Callers 2

NewClientFunction · 0.70

Calls 1

NewTLSConfigFunction · 0.92

Tested by

no test coverage detected