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

Method APIHostForHost

internal/config/config.go:460–469  ·  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

458// APIHostForHost returns the api_host configured for host, reporting false when
459// the host has no api_host set. It is the inverse of HostForAPIHost.
460func (c *AuthConfig) APIHostForHost(host string) (string, bool) {
461 if host == "" || c.cfg == nil {
462 return "", false
463 }
464 configured, err := c.cfg.Get([]string{hostsKey, host, apiHostKey})
465 if err != nil || configured == "" {
466 return "", false
467 }
468 return configured, true
469}
470
471// HostForAPIHost returns the configured host whose api_host points at apiHost,
472// reporting false when no host claims it.

Callers

nothing calls this directly

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected