MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / limiter

Struct limiter

pkg/limiterp/limit.go:19–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19type limiter struct {
20 cmd redis.Cmdable
21 // 时间窗口间隔
22 interval time.Duration
23 // 阈值
24 rate int
25}
26
27func NewRedisSlidingWindowLimiter(cmd redis.Cmdable, interval time.Duration, rate int) Limiter {
28 return &limiter{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected