kubernetes/staging/src/k8s.io/client-go/util/flowcontrol/throttle.go

type PassiveRateLimiter

type RateLimiter

type tokenBucketPassiveRateLimiter

type tokenBucketRateLimiter

// NewTokenBucketRateLimiter creates a rate limiter which implements a token bucket approach.
// The rate limiter allows bursts of up to 'burst' to exceed the QPS, while still maintaining a
// smoothed qps rate of 'qps'.
// The bucket is initially filled with 'burst' tokens, and refills at a rate of 'qps'.
// The maximum number of tokens in the bucket is capped at 'burst'.
func NewTokenBucketRateLimiter(qps float32, burst int) RateLimiter {}

// NewTokenBucketPassiveRateLimiter is similar to NewTokenBucketRateLimiter except that it returns
// a PassiveRateLimiter which does not have Accept() and Wait() methods.
func NewTokenBucketPassiveRateLimiter(qps float32, burst int) PassiveRateLimiter {}

type Clock

var _

// NewTokenBucketRateLimiterWithClock is identical to NewTokenBucketRateLimiter
// but allows an injectable clock, for testing.
func NewTokenBucketRateLimiterWithClock(qps float32, burst int, c Clock) RateLimiter {}

// NewTokenBucketPassiveRateLimiterWithClock is similar to NewTokenBucketRateLimiterWithClock
// except that it returns a PassiveRateLimiter which does not have Accept() and Wait() methods
// and uses a PassiveClock.
func NewTokenBucketPassiveRateLimiterWithClock(qps float32, burst int, c clock.PassiveClock) PassiveRateLimiter {}

func newTokenBucketRateLimiterWithClock(limiter *rate.Limiter, c Clock, qps float32) *tokenBucketRateLimiter {}

func newTokenBucketRateLimiterWithPassiveClock(limiter *rate.Limiter, c clock.PassiveClock, qps float32) *tokenBucketPassiveRateLimiter {}

func (tbprl *tokenBucketPassiveRateLimiter) Stop() {}

func (tbprl *tokenBucketPassiveRateLimiter) QPS() float32 {}

func (tbprl *tokenBucketPassiveRateLimiter) TryAccept() bool {}

// Accept will block until a token becomes available
func (tbrl *tokenBucketRateLimiter) Accept() {}

func (tbrl *tokenBucketRateLimiter) Wait(ctx context.Context) error {}

type fakeAlwaysRateLimiter

func NewFakeAlwaysRateLimiter() RateLimiter {}

func (t *fakeAlwaysRateLimiter) TryAccept() bool {}

func (t *fakeAlwaysRateLimiter) Stop() {}

func (t *fakeAlwaysRateLimiter) Accept() {}

func (t *fakeAlwaysRateLimiter) QPS() float32 {}

func (t *fakeAlwaysRateLimiter) Wait(ctx context.Context) error {}

type fakeNeverRateLimiter

func NewFakeNeverRateLimiter() RateLimiter {}

func (t *fakeNeverRateLimiter) TryAccept() bool {}

func (t *fakeNeverRateLimiter) Stop() {}

func (t *fakeNeverRateLimiter) Accept() {}

func (t *fakeNeverRateLimiter) QPS() float32 {}

func (t *fakeNeverRateLimiter) Wait(ctx context.Context) error {}

var _

var _

var _

var _