1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Make client underlying HTTP client accessible

Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
This commit is contained in:
Mathieu Champlon 2018-05-15 15:12:30 +02:00
parent 04864cb3cb
commit 5a84124739
2 changed files with 7 additions and 0 deletions

View file

@ -356,6 +356,11 @@ func (cli *Client) DaemonHost() string {
return cli.host
}
// HTTPClient returns a copy of the HTTP client bound to the server
func (cli *Client) HTTPClient() *http.Client {
return &*cli.client
}
// ParseHostURL parses a url string, validates the string is a host url, and
// returns the parsed URL
func ParseHostURL(host string) (*url.URL, error) {

View file

@ -4,6 +4,7 @@ import (
"context"
"io"
"net"
"net/http"
"time"
"github.com/docker/docker/api/types"
@ -33,6 +34,7 @@ type CommonAPIClient interface {
VolumeAPIClient
ClientVersion() string
DaemonHost() string
HTTPClient() *http.Client
ServerVersion(ctx context.Context) (types.Version, error)
NegotiateAPIVersion(ctx context.Context)
NegotiateAPIVersionPing(types.Ping)