GetAPI gets the value of the CF_INT_API environment variable, if set, and prefixes it with "https://" if the value doesn't already start with "http". If the variable is not set, returns "https://api.bosh-lite.com".
()
| 43 | // it with "https://" if the value doesn't already start with "http". If the variable |
| 44 | // is not set, returns "https://api.bosh-lite.com". |
| 45 | func GetAPI() string { |
| 46 | apiURL := os.Getenv("CF_INT_API") |
| 47 | if apiURL == "" { |
| 48 | return "https://api.bosh-lite.com" |
| 49 | } |
| 50 | if !strings.HasPrefix(apiURL, "http") { |
| 51 | apiURL = fmt.Sprintf("https://%s", apiURL) |
| 52 | } |
| 53 | |
| 54 | return apiURL |
| 55 | } |
| 56 | |
| 57 | // LoginAs logs into the CLI with 'cf auth' and the given username and password, |
| 58 | // retrying up to 3 times on failures. |
no outgoing calls
no test coverage detected