transport

package
v2.1.0-rc.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2015 License: Apache-2.0 Imports: 9 Imported by: 1,962

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTransport

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.

Types

type ReadSeekCloser

type ReadSeekCloser interface {
	io.ReadSeeker
	io.Closer
}

ReadSeekCloser combines io.ReadSeeker with io.Closer.

func NewHTTPReadSeeker

func NewHTTPReadSeeker(client *http.Client, url string, size int64) 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

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

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

func NewHeaderRequestModifier

func NewHeaderRequestModifier(header http.Header) RequestModifier

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

Jump to

Keyboard shortcuts

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