go-redis / redis_rate

Rate limiting for go-redis
https://redis.uptrace.dev/guide/go-redis-rate-limiting.html
BSD 2-Clause "Simplified" License
844 stars 101 forks source link

Support customized redis key prefix #74

Open dcb9 opened 2 years ago

dcb9 commented 2 years ago

Fixed key prefix limits the project potential in a complex situation

ovdienkonikolai commented 1 year ago

Hello, this issue is relevant to us, we would like to see these changes in the main branch. What's preventing the merge?

freddierice commented 9 months ago

I'm also interested in this feature.

I'm not a maintainer, but it looks like you're breaking the type signature of the Limiter constructor. Another approach could be to add limiter options, for example:

type LimiterOpt func(*Limiter)
func NewLimiter(rdb rediser, opts ...LimiterOpt) *Limiter {
     ...
}
dcb9 commented 9 months ago

@freddierice I totally agree with you, I'll change the approach to option pattern without changing default behavior.