kubernetesk8s.io/kubernetes/pkg/kubelet/apis/grpc Index | Files

package grpc

import "k8s.io/kubernetes/pkg/kubelet/apis/grpc"

Index

Variables

var (
	ErrorLimitExceeded = status.Error(codes.ResourceExhausted, "rejected by rate limit")
)

Functions

func LimiterUnaryServerInterceptor

func LimiterUnaryServerInterceptor(limiter Limiter) grpc.UnaryServerInterceptor

LimiterUnaryServerInterceptor returns a new unary server interceptors that performs request rate limiting.

func WithRateLimiter

func WithRateLimiter(serviceName string, qps, burstTokens int32) grpc.ServerOption

WithRateLimiter creates new rate limiter with unary interceptor.

Types

type Limiter

type Limiter interface {
	// Allow reports whether an event may happen now.
	Allow() bool
}

Limiter defines the interface to perform request rate limiting, based on the interface exposed by https://pkg.go.dev/golang.org/x/time/rate#Limiter

Source Files

ratelimit.go

Version
v1.33.0 (latest)
Published
Apr 23, 2025
Platform
linux/amd64
Imports
6 packages
Last checked
3 hours ago

Tools for package owners.