Initial open source release
This commit is contained in:
commit
74992e893f
377 changed files with 118084 additions and 0 deletions
11
internal/store/ratelimit.go
Normal file
11
internal/store/ratelimit.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package store
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
// RateLimiter 提供轻量窗口限流。返回 retryAfterSeconds 供 RPC 映射 FLOOD_WAIT_X。
|
||||
type RateLimiter interface {
|
||||
Allow(ctx context.Context, key string, limit int, window time.Duration) (allowed bool, retryAfterSeconds int, err error)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue