ratelimit

package
v0.1.103 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FixWindowLimiter

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

func NewFixWindowLimiter

func NewFixWindowLimiter(timeDuration time.Duration, rate int64) *FixWindowLimiter

func (*FixWindowLimiter) Build

type SlideWindowLimiter

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

func NewSlideWindowLimiter

func NewSlideWindowLimiter(interval time.Duration, rate int) *SlideWindowLimiter

func (*SlideWindowLimiter) Build

type TokenBucketLimiter

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

令牌桶

func NewTokenBucketLimiter

func NewTokenBucketLimiter(capacity int, interval time.Duration) *TokenBucketLimiter

func (*TokenBucketLimiter) Build

func (*TokenBucketLimiter) Close

func (t *TokenBucketLimiter) Close()

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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