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

Function NewClient

api/uaa/client.go:27–45  ·  view source on GitHub ↗

NewClient returns a new UAA Client with the provided configuration

(config Config)

Source from the content-addressed store, hash-verified

25
26// NewClient returns a new UAA Client with the provided configuration
27func NewClient(config Config) *Client {
28 userAgent := fmt.Sprintf("%s/%s (%s; %s %s)",
29 config.BinaryName(),
30 config.BinaryVersion(),
31 runtime.Version(),
32 runtime.GOARCH,
33 runtime.GOOS,
34 )
35
36 client := Client{
37 config: config,
38
39 connection: NewConnection(config.SkipSSLValidation(), config.UAADisableKeepAlives(), config.DialTimeout()),
40 userAgent: userAgent,
41 }
42 client.WrapConnection(NewErrorWrapper())
43
44 return &client
45}

Callers 5

newWrappedUAAClientFunction · 0.92
version_test.goFile · 0.92
prompts_test.goFile · 0.92
NewTestUAAClientAndStoreFunction · 0.70
resources_test.goFile · 0.70

Calls 9

WrapConnectionMethod · 0.95
VersionMethod · 0.80
NewConnectionFunction · 0.70
NewErrorWrapperFunction · 0.70
BinaryNameMethod · 0.65
BinaryVersionMethod · 0.65
SkipSSLValidationMethod · 0.65
UAADisableKeepAlivesMethod · 0.65
DialTimeoutMethod · 0.65

Tested by 1

NewTestUAAClientAndStoreFunction · 0.56