mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #37071 from mat007/custom-request
Extend client API with custom HTTP requests
This commit is contained in:
commit
d37f5c6bdf
2 changed files with 7 additions and 0 deletions
|
@ -356,6 +356,11 @@ func (cli *Client) DaemonHost() string {
|
||||||
return cli.host
|
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
|
// ParseHostURL parses a url string, validates the string is a host url, and
|
||||||
// returns the parsed URL
|
// returns the parsed URL
|
||||||
func ParseHostURL(host string) (*url.URL, error) {
|
func ParseHostURL(host string) (*url.URL, error) {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
|
@ -33,6 +34,7 @@ type CommonAPIClient interface {
|
||||||
VolumeAPIClient
|
VolumeAPIClient
|
||||||
ClientVersion() string
|
ClientVersion() string
|
||||||
DaemonHost() string
|
DaemonHost() string
|
||||||
|
HTTPClient() *http.Client
|
||||||
ServerVersion(ctx context.Context) (types.Version, error)
|
ServerVersion(ctx context.Context) (types.Version, error)
|
||||||
NegotiateAPIVersion(ctx context.Context)
|
NegotiateAPIVersion(ctx context.Context)
|
||||||
NegotiateAPIVersionPing(types.Ping)
|
NegotiateAPIVersionPing(types.Ping)
|
||||||
|
|
Loading…
Reference in a new issue