middleware

package
v0.0.0-...-c42b1bb Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextRoundTripper

type ContextRoundTripper struct {
	Transport http.RoundTripper
	Ctx       context.Context
}

func (*ContextRoundTripper) RoundTrip

func (rt *ContextRoundTripper) RoundTrip(r *http.Request) (*http.Response, error)

type RateLimiters

type RateLimiters struct {
	RPS, Burst int
	// contains filtered or unexported fields
}

func (*RateLimiters) RoundTripper

func (limiters *RateLimiters) RoundTripper(rt http.RoundTripper, host string) http.RoundTripper

Limit returns a RoundTripper for a particular host. We expect to do a number of requests to a particular host at a time.

type RoundTripRateLimiter

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

func (*RoundTripRateLimiter) RoundTrip

func (t *RoundTripRateLimiter) RoundTrip(r *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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