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

Function NewClient

api/router/client.go:40–60  ·  view source on GitHub ↗

NewClient returns a new Router Client.

(config Config)

Source from the content-addressed store, hash-verified

38
39// NewClient returns a new Router Client.
40func NewClient(config Config) *Client {
41 userAgent := fmt.Sprintf("%s/%s (%s; %s %s)",
42 config.AppName,
43 config.AppVersion,
44 runtime.Version(),
45 runtime.GOARCH,
46 runtime.GOOS,
47 )
48
49 client := Client{
50 userAgent: userAgent,
51 router: rata.NewRequestGenerator(config.RoutingEndpoint, internal.APIRoutes),
52 connection: NewConnection(config.ConnectionConfig),
53 }
54
55 for _, wrapper := range config.Wrappers {
56 client.connection = wrapper.Wrap(client.connection)
57 }
58
59 return &client
60}

Callers 2

newWrappedRoutingClientFunction · 0.92
NewTestRouterClientFunction · 0.92

Calls 3

VersionMethod · 0.80
NewConnectionFunction · 0.70
WrapMethod · 0.65

Tested by 1

NewTestRouterClientFunction · 0.74