Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group represents a slice of constraints that must all be satisfied to succeed.
type Limiter ¶
Limiter describes a common interface to describe the constraint on a request. If the constrain is satified then the request can continue.
type LimiterFunc ¶
LimiterFunc is an adapter to allow the use of functions without a receiver as limiters. If `f` is a function with the appropriate signature, LimiterFunc(f) is a Limiter that calls `f`.
type Transport ¶
type Transport struct { Transport http.RoundTripper // Used to make actual requests. // contains filtered or unexported fields }
Transport implements http.RoundTripper and throttles requests described by the constraints of one or more Limiter values.
func New ¶
func New(transport http.RoundTripper, l ...Limiter) *Transport
New returns a RoundTripper that throttles HTTP requests.
func NewWithDefaultTransport ¶
NewWithDefaultTransport returns a RoundTripper that throttles HTTP requests.