# Packages
Package celllimiter 限制器可以用于防止短时间内大量请求同时处理,比如缓存防击穿,防爬虫等.
# Functions
ClThrottleInPipe 增加桶中token数并返回桶状态@params count int64 增加的token数量@params opts ...optparams.Option[ClThrottleOpts] 其他参数,注意默认MaxBurst: 99,CountPerPeriod: 30,Period: 60.
New 创建一个新的令牌桶对象@params cli redis.UniversalClient.
RefreshTTL 设置总是刷新,该参数对pipeline无效.
RefreshTTLAtFirstTime 设置使用MaxTTL在key第一次设置时设置过期,该参数对pipeline无效.
WithAutoRefreshInterval 设置自动刷新过期时间的设置.
WithCountPerPeriod 设置时间间隔内的token消减数.
WithDefaultCountPerPeriod 设置时间间隔内的token消减数.
WithDefaultMaxBurst 设置最大熔断数,最大token数为MaxBurst+1.
WithDefaultPeriod 设置token消减间隔时长,单位s.
WithKey 中间件通用设置,指定使用的键,注意设置后namespace依然有效.
WithMaxBurst 设置最大熔断数,最大token数为MaxBurst+1.
WithMaxTTL 设置token消减间隔时长,单位s.
WithMiddlewaretype 设置中间件类型.
WithNamespace 中间件通用设置,指定锁的命名空间.
WithPeriod 设置token消减间隔时长,单位s.
WithSpecifiedKey 中间件通用设置,指定使用的键,注意设置key后namespace将失效.
WithTaskCron 设置定时器.
WithTTL 设置总是使用指定的ttl刷新key,该参数对pipeline无效.
WithTTL 设置总是使用指定的ttl刷新key.
# Variables
No description provided by the author
# Structs
No description provided by the author
ClThrottleOpt ClThrottle的配置.
Options broker的配置.
RedisCell 令牌桶对象.
RedisCellStatus 令牌桶的状态信息.