This commit exposes `Client.host` as `Client.DaemonHost()`
This allows users of the client, a CLI for example, to query the Host
that the client is attempting to contact and vary their behaviour
accordingly. For example, to allow client-side configuration of
HTTP proxy settings for a number of different docker hosts.
Signed-off-by: Dave Tucker <dt@docker.com>
| ... | ... |
@@ -247,6 +247,12 @@ func (cli *Client) UpdateClientVersion(v string) {
|
| 247 | 247 |
|
| 248 | 248 |
} |
| 249 | 249 |
|
| 250 |
+// DaemonHost returns the host associated with this instance of the Client. |
|
| 251 |
+// This operation doesn't acquire a mutex. |
|
| 252 |
+func (cli *Client) DaemonHost() string {
|
|
| 253 |
+ return cli.host |
|
| 254 |
+} |
|
| 255 |
+ |
|
| 250 | 256 |
// ParseHost verifies that the given host strings is valid. |
| 251 | 257 |
func ParseHost(host string) (string, string, string, error) {
|
| 252 | 258 |
protoAddrParts := strings.SplitN(host, "://", 2) |