grpc_ratelimit

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StreamServerInterceptor

func StreamServerInterceptor(limiter Limiter) grpc.StreamServerInterceptor

StreamServerInterceptor returns a new stream server interceptor that performs rate limiting on the request.

func UnaryServerInterceptor

func UnaryServerInterceptor(limiter Limiter) grpc.UnaryServerInterceptor

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

Types

type Limiter

type Limiter interface {
	Limit() bool
}

Limiter defines the interface to perform request rate limiting. If Limit function return true, the request will be rejected. Otherwise, the request will pass.

Jump to

Keyboard shortcuts

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