ratelimit

package
v3.6.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Number of events to pass to the crane rate limiter to match the
	// AR api limits:
	// https://github.com/kubernetes/registry.k8s.io/issues/153#issuecomment-1460913153
	// bentheelder: (83*60=4980)
	// Temp: We are temporarily dropping this from the max of 83 to
	// two thirds while the rate limiter is instrumented everywhere.
	MaxEvents = 50
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RoundTripper

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

RoundTripper wraps an http.RoundTripper with rate limiting

var Limiter *RoundTripper

func NewRoundTripper

func NewRoundTripper(limit rate.Limit) *RoundTripper

func (*RoundTripper) RoundTrip

func (rt *RoundTripper) 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