# README
ratelimit
限流分为单机限流和分布式限流。
限流算法
- 令牌桶
- 漏斗
- 滑动窗口
- 自适应限流
扩展
https://pkg.go.dev/golang.org/x/time/rate
https://github.com/alibaba/sentinel-golang
https://github.com/uber-go/ratelimit
https://github.com/go-kratos/aegis/tree/main/ratelimit
https://github.com/RussellLuo/slidingwindow
Reference
# Packages
No description provided by the author
# Functions
Align returns a func to customize a RedisSlidingWindow with alignment.
NewCounter 单机版计数器 构造函数.
No description provided by the author
NewRedisSlidingWindow 返回具有给定参数的RedisSlidingWindow。.
No description provided by the author
No description provided by the author
NewTokenLimiter 返回一个新的令牌限制器,该令牌限制器允许事件达到速率,并允许最多突发令牌的突发。.
# Variables
ErrUnknownCode is an error that represents unknown status code.
# Structs
Counter 单机版计数器.
LeakyBucket 单机版漏桶算法.
No description provided by the author
RedisTokenBucket 控制事件在一秒钟内发生的频率。.
SlidingWindow 单机版滑动窗口.
TokenBucket 单机版令牌桶.
UberLeakyBucket uber单机版漏桶算法.
# Type aliases
No description provided by the author