client

package
v0.0.0-...-73522ac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents a HTTP client connection to a Docker registry.

func CreateClient

func CreateClient(dockerConfig *configfile.ConfigFile) Client

CreateClient create a Client object, using a real HttpClient implementation.

func CreateClientProvidingHTTPClient

func CreateClientProvidingHTTPClient(httpClient HTTPClient, dockerConfig *configfile.ConfigFile) Client

CreateClientProvidingHTTPClient create a Client object, using the provided HttpClient implementation.

func (*Client) GetV2Manifest

func (c *Client) GetV2Manifest(url string) (schema2.Manifest, error)

GetV2Manifest returns the Docker V2 manifest object that corresponds with the provided registry URL.

func (*Client) PutV2Manifest

func (c *Client) PutV2Manifest(url string, v2Manifest schema2.Manifest) error

PutV2Manifest associates the Docker V2 manifest object with the given tag.

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient acts as facade on http.Client, allowing for mock implementations.

type HTTPClientImpl

type HTTPClientImpl struct {
	// contains filtered or unexported fields
}

HTTPClientImpl implements HTTPClient, and acts as a facade on http.Client, implementing just the Do method.

func (HTTPClientImpl) Do

func (h HTTPClientImpl) Do(req *http.Request) (*http.Response, error)

Do sends an HTTP request and returns an HTTP response. This just calls the equivalent method on http.Client.

type MockHTTPClient

type MockHTTPClient struct {
	// contains filtered or unexported fields
}

MockHTTPClient is a mock implementation of HttpClient.

func CreateMockHTTPClient

func CreateMockHTTPClient(res ...http.Response) MockHTTPClient

CreateMockHTTPClient creates a MockHttpClient that returns http.Responses.

func CreateMockHTTPClientErr

func CreateMockHTTPClientErr(err error) MockHTTPClient

CreateMockHTTPClientErr creates a MockHttpClient that returns errors.

func (MockHTTPClient) Do

func (m MockHTTPClient) Do(req *http.Request) (*http.Response, error)

Do is the mock implementation of the real http.Client.Do method.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL