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