middleware

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCoalesced

func NewCoalesced(next http.RoundTripper) http.RoundTripper

NewCoalesced returns a coalesced http roundtripper.

Types

type Transport

type Transport struct {
	// The RoundTripper interface actually used to make requests.
	// If nil, http.DefaultTransport is used.
	Transport http.RoundTripper

	// Cache is the http cache.
	Cache *cache.HttpCache
	// contains filtered or unexported fields
}

Transport is the http filter implementing the http caching logic.

func NewCachedTransport

func NewCachedTransport(c *cache.HttpCache) *Transport

NewTransport returns a new Transport with the provided Cache implementation.

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error)

RoundTrip issues a http roundtrip and applies the http caching logic.

Jump to

Keyboard shortcuts

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