roundtripper

package
v0.0.0-...-0378f4a Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ResponseIsToLarge = errors.New("response body is to large for the cache")

Functions

This section is empty.

Types

type CacheTransport

type CacheTransport struct {
	Cache     *cache.LRUCache
	Transport http.RoundTripper // underlying transport (or default if nil)
}

func (*CacheTransport) RoundTrip

func (t *CacheTransport) RoundTrip(req *http.Request) (*http.Response, error)

type LoggedTransport

type LoggedTransport struct {
	Logger    func(v ...interface{})
	Transport http.RoundTripper // underlying transport (or default if nil)
}

A LoggedTransport prints URLs and timings for each HTTP request.

func (*LoggedTransport) RoundTrip

func (t *LoggedTransport) RoundTrip(req *http.Request) (*http.Response, error)

type ResponseBodyLimitRoundTripper

type ResponseBodyLimitRoundTripper struct {
	Limit     int64
	Transport http.RoundTripper // underlying transport (or default if nil)
}

func (*ResponseBodyLimitRoundTripper) RoundTrip

Jump to

Keyboard shortcuts

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