limiter

package
v0.1.33 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LimiterDropError = errors.New("drop request")
)

Functions

func WithServerLimiterInterceptor

func WithServerLimiterInterceptor() grpc.UnaryServerInterceptor

Types

type BBR

type BBR interface {
	Allow() (DoneFunc, error)
}

func NewBbrLimiter

func NewBbrLimiter(opts ...Option) BBR

type DoneFunc

type DoneFunc func()

type Option

type Option func(*options)

func WithBucketDuration

func WithBucketDuration(bucketDuration time.Duration) Option

WithBucketDuration 修改 bucketDuration

func WithBucketNum

func WithBucketNum(bucketSize int) Option

WithBucketNum 修改 BucketNum

func WithCpuThreshold

func WithCpuThreshold(cpuThreshold uint32) Option

WithCpuThreshold 修改 cpuThreshold 参数

Jump to

Keyboard shortcuts

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