Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RateLimiterRepository ¶
type RateLimiterRepository interface { // AddRequestCount implement redis slide windows algorithm // When too many request will return -1 // ref : https://en.wikipedia.org/wiki/Sliding_window_protocol AddRequestCount(ctx context.Context, key string, maxCount, timeUintSecond int64) (count int64, err error) }
RateLimiterRepository define rate limit method
func NewRateLimiterRepository ¶
func NewRateLimiterRepository(redisClient *redis.Client) RateLimiterRepository
NewRateLimiterRepository ...
Click to show internal directories.
Click to hide internal directories.