MCPcopy
hub / github.com/cli/cli / RESTPrefix

Function RESTPrefix

internal/ghinstance/host.go:59–70  ·  view source on GitHub ↗
(hostname string)

Source from the content-addressed store, hash-verified

57}
58
59func 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
72func GistPrefix(hostname string) string {
73 prefix := "https://"

Callers 15

searchMethod · 0.92
deleteTagFunction · 0.92
FetchRefSHAFunction · 0.92
fetchReleasePathFunction · 0.92
getTagsFunction · 0.92
generateReleaseNotesFunction · 0.92
publishedReleaseExistsFunction · 0.92
createReleaseFunction · 0.92
editReleaseFunction · 0.92
GetScopesFunction · 0.92
deleteGPGKeyFunction · 0.92
getGPGKeysFunction · 0.92

Calls 1

isGarageFunction · 0.85

Tested by 1

TestRESTPrefixFunction · 0.68