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

Function newWrappedRoutingClient

command/v7/shared/new_clients.go:100–133  ·  view source on GitHub ↗
(config command.Config, ui command.UI, uaaClient *uaa.Client)

Source from the content-addressed store, hash-verified

98}
99
100func 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
135func connectToCF(config command.Config, ui command.UI, ccClient *ccv3.Client, minVersionV3 string) (*ccv3.Client, error) {
136 if config.Target() == "" {

Callers 1

Calls 10

NewClientFunction · 0.92
BinaryNameMethod · 0.65
BinaryVersionMethod · 0.65
DialTimeoutMethod · 0.65
SkipSSLValidationMethod · 0.65
RoutingEndpointMethod · 0.65
VerboseMethod · 0.65
B3TraceIDMethod · 0.65

Tested by

no test coverage detected