(config command.Config, ui command.UI, uaaClient *uaa.Client)
| 98 | } |
| 99 | |
| 100 | func newWrappedRoutingClient(config command.Config, ui command.UI, uaaClient *uaa.Client) (*router.Client, error) { |
| 101 | routingConfig := router.Config{ |
| 102 | AppName: config.BinaryName(), |
| 103 | AppVersion: config.BinaryVersion(), |
| 104 | ConnectionConfig: router.ConnectionConfig{ |
| 105 | DialTimeout: config.DialTimeout(), |
| 106 | SkipSSLValidation: config.SkipSSLValidation(), |
| 107 | }, |
| 108 | RoutingEndpoint: config.RoutingEndpoint(), |
| 109 | } |
| 110 | |
| 111 | routingWrappers := []router.ConnectionWrapper{routingWrapper.NewErrorWrapper()} |
| 112 | |
| 113 | verbose, location := config.Verbose() |
| 114 | |
| 115 | if verbose { |
| 116 | routingWrappers = append(routingWrappers, routingWrapper.NewRequestLogger(ui.RequestLoggerTerminalDisplay())) |
| 117 | } |
| 118 | |
| 119 | if location != nil { |
| 120 | routingWrappers = append(routingWrappers, routingWrapper.NewRequestLogger(ui.RequestLoggerFileWriter(location))) |
| 121 | } |
| 122 | |
| 123 | authWrapper := routingWrapper.NewUAAAuthentication(uaaClient, config) |
| 124 | |
| 125 | routingWrappers = append(routingWrappers, authWrapper) |
| 126 | routingWrappers = append(routingWrappers, routingWrapper.NewRoutingTraceHeaderRequest(config.B3TraceID())) |
| 127 | |
| 128 | routingConfig.Wrappers = routingWrappers |
| 129 | |
| 130 | routingClient := router.NewClient(routingConfig) |
| 131 | |
| 132 | return routingClient, nil |
| 133 | } |
| 134 | |
| 135 | func connectToCF(config command.Config, ui command.UI, ccClient *ccv3.Client, minVersionV3 string) (*ccv3.Client, error) { |
| 136 | if config.Target() == "" { |
no test coverage detected