(hostname string)
| 57 | } |
| 58 | |
| 59 | func RESTPrefix(hostname string) string { |
| 60 | if isGarage(hostname) { |
| 61 | return fmt.Sprintf("https://%s/api/v3/", hostname) |
| 62 | } |
| 63 | if ghauth.IsEnterprise(hostname) { |
| 64 | return fmt.Sprintf("https://%s/api/v3/", hostname) |
| 65 | } |
| 66 | if strings.EqualFold(hostname, localhost) { |
| 67 | return fmt.Sprintf("http://api.%s/", hostname) |
| 68 | } |
| 69 | return fmt.Sprintf("https://api.%s/", hostname) |
| 70 | } |
| 71 | |
| 72 | func GistPrefix(hostname string) string { |
| 73 | prefix := "https://" |