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

Function NewConnection

api/router/router_connection.go:30–43  ·  view source on GitHub ↗

NewConnection returns a pointer to a new RouterConnection with the provided configuration

(config ConnectionConfig)

Source from the content-addressed store, hash-verified

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

Callers 1

NewClientFunction · 0.70

Calls 1

NewTLSConfigFunction · 0.92

Tested by

no test coverage detected