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)
| 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. |
| 436 | func (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. |