MCPcopy Create free account
hub / github.com/cli/cli / APIHostForHost

Method APIHostForHost

internal/config/config.go:436–445  ·  view source on GitHub ↗

APIHostForHost returns the api_host configured for host, reporting false when the host has no api_host set. It is the inverse of HostForAPIHost.

(host string)

Source from the content-addressed store, hash-verified

434// APIHostForHost returns the api_host configured for host, reporting false when
435// the host has no api_host set. It is the inverse of HostForAPIHost.
436func (c *AuthConfig) APIHostForHost(host string) (string, bool) {
437 if host == "" || c.cfg == nil {
438 return "", false
439 }
440 configured, err := c.cfg.Get([]string{hostsKey, host, apiHostKey})
441 if err != nil || configured == "" {
442 return "", false
443 }
444 return configured, true
445}
446
447// HostForAPIHost returns the configured host whose api_host points at apiHost,
448// reporting false when no host claims it.

Callers

nothing calls this directly

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected