distribution: github.com/docker/distribution/registry/client/transport Index | Files

package transport

import "github.com/docker/distribution/registry/client/transport"

Index

Package Files

http_reader.go transport.go

Variables

var (

    // ErrWrongCodeForByteRange is returned if the client sends a request
    // with a Range header but the server returns a 2xx or 3xx code other
    // than 206 Partial Content.
    ErrWrongCodeForByteRange = errors.New("expected HTTP 206 from byte range request")
)

func NewTransport Uses

func NewTransport(base http.RoundTripper, modifiers ...RequestModifier) http.RoundTripper

NewTransport creates a new transport which will apply modifiers to the request on a RoundTrip call.

type ReadSeekCloser Uses

type ReadSeekCloser interface {
    io.ReadSeeker
    io.Closer
}

ReadSeekCloser combines io.ReadSeeker with io.Closer.

func NewHTTPReadSeeker Uses

func NewHTTPReadSeeker(client *http.Client, url string, errorHandler func(*http.Response) error) ReadSeekCloser

NewHTTPReadSeeker handles reading from an HTTP endpoint using a GET request. When seeking and starting a read from a non-zero offset the a "Range" header will be added which sets the offset. TODO(dmcgowan): Move this into a separate utility package

type RequestModifier Uses

type RequestModifier interface {
    ModifyRequest(*http.Request) error
}

RequestModifier represents an object which will do an inplace modification of an HTTP request.

func NewHeaderRequestModifier Uses

func NewHeaderRequestModifier(header http.Header) RequestModifier

NewHeaderRequestModifier returns a new RequestModifier which will add the given headers to a request.

Package transport imports 7 packages (graph) and is imported by 1599 packages. Updated 2018-08-09. Refresh now. Tools for package owners.