MCPcopy Create free account
hub / github.com/cloudfoundry/credhub-cli / Info

Method Info

credhub/info.go:12–30  ·  view source on GitHub ↗

Info returns the targeted CredHub server information.

()

Source from the content-addressed store, hash-verified

10
11// Info returns the targeted CredHub server information.
12func (ch *CredHub) Info() (*server.Info, error) {
13 //This uses a the private 'request' as it makes an https call but it does not require authentication
14 response, err := ch.request(ch.Client(), "GET", "/info", nil, nil, true)
15 if err != nil {
16 return nil, err
17 }
18
19 defer response.Body.Close()
20 defer io.Copy(io.Discard, response.Body)
21
22 info := &server.Info{}
23 decoder := json.NewDecoder(response.Body)
24
25 if err = decoder.Decode(&info); err != nil {
26 return nil, err
27 }
28
29 return info, nil
30}
31
32// AuthURL returns the targeted CredHub server's trusted authentication server URL.
33func (ch *CredHub) AuthURL() (string, error) {

Callers 4

AuthURLMethod · 0.95
ServerVersionMethod · 0.95
info_test.goFile · 0.80
GetApiInfoFunction · 0.80

Calls 2

requestMethod · 0.95
ClientMethod · 0.95

Tested by

no test coverage detected