NewClient creates a new V2 Cloud Controller client and UAA client using the passed in config.
(config command.Config, ui command.UI, skipSSLValidation bool)
| 9 | // NewClient creates a new V2 Cloud Controller client and UAA client using the |
| 10 | // passed in config. |
| 11 | func 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 | } |
no test coverage detected