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

Method ServerVersion

credhub/server_version.go:11–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9)
10
11func (ch *CredHub) ServerVersion() (*version.Version, error) {
12 if ch.cachedServerVersion != "" {
13 return version.NewVersion(ch.cachedServerVersion)
14 }
15
16 info, err := ch.Info()
17 if err != nil {
18 return nil, err
19 }
20 v := info.App.Version
21 if v == "" {
22 v, err = ch.getVersion()
23 if err != nil {
24 return nil, err
25 }
26 }
27
28 return version.NewVersion(v)
29}
30
31func (ch *CredHub) getVersion() (string, error) {
32 response, err := ch.Request("GET", "/version", nil, nil, true)

Callers 12

RegenerateMethod · 0.95
setCredentialMethod · 0.95
generateCredentialMethod · 0.95
AddPermissionMethod · 0.95
UpdatePermissionMethod · 0.95
DeletePermissionMethod · 0.95
ExecuteMethod · 0.80
ExecuteMethod · 0.80
ExecuteMethod · 0.80
ExecuteMethod · 0.80
PrintVersionFunction · 0.80

Calls 2

InfoMethod · 0.95
getVersionMethod · 0.95

Tested by

no test coverage detected