MCPcopy
hub / github.com/cloudfoundry/cli / NewClient

Function NewClient

command/plugin/shared/new_client.go:11–32  ·  view source on GitHub ↗

NewClient creates a new V2 Cloud Controller client and UAA client using the passed in config.

(config command.Config, ui command.UI, skipSSLValidation bool)

Source from the content-addressed store, hash-verified

9// NewClient creates a new V2 Cloud Controller client and UAA client using the
10// passed in config.
11func NewClient(config command.Config, ui command.UI, skipSSLValidation bool) *plugin.Client {
12
13 verbose, location := config.Verbose()
14
15 pluginClient := plugin.NewClient(plugin.Config{
16 AppName: config.BinaryName(),
17 AppVersion: config.BinaryVersion(),
18 DialTimeout: config.DialTimeout(),
19 SkipSSLValidation: skipSSLValidation,
20 })
21
22 if verbose {
23 pluginClient.WrapConnection(wrapper.NewRequestLogger(ui.RequestLoggerTerminalDisplay()))
24 }
25 if location != nil {
26 pluginClient.WrapConnection(wrapper.NewRequestLogger(ui.RequestLoggerFileWriter(location)))
27 }
28
29 pluginClient.WrapConnection(wrapper.NewRetryRequest(config.RequestRetryCount()))
30
31 return pluginClient
32}

Callers 3

SetupMethod · 0.92
SetupMethod · 0.92
SetupMethod · 0.92

Calls 11

WrapConnectionMethod · 0.95
NewClientFunction · 0.92
NewRequestLoggerFunction · 0.92
NewRetryRequestFunction · 0.92
VerboseMethod · 0.65
BinaryNameMethod · 0.65
BinaryVersionMethod · 0.65
DialTimeoutMethod · 0.65
RequestRetryCountMethod · 0.65

Tested by

no test coverage detected