mennanov / limiters

Golang rate limiters for distributed applications
https://godoc.org/github.com/mennanov/limiters
MIT License
448 stars 49 forks source link

Reset or Clear a Limit #19

Open patramsey opened 1 year ago

patramsey commented 1 year ago

Hello,

It does not appear that this package allows for the reset of a limit, is that correct? I have come across a use case where rate limits need to be reset. A user forgets their password, gets rate limited logging into their account. They successfully reset their password, the previous limit should be cleared so they are allowed to attempt to login again.

Would you consider a PR for this feature?

mennanov commented 1 year ago

I think this is a useful feature, PR would be more than welcomed!

mennanov commented 1 year ago

@patramsey would you be interested in creating a pull request with the feature you described? I'd be happy to review and merge it. Thanks!

Madraceee commented 2 weeks ago

Hey, This looks interesting and I also want to learn this repository. Can I solve this issue or is it already solved?

mennanov commented 2 weeks ago

This is not solved. If you're interested in implementing it please consider making a pull request

Thanks!

Madraceee commented 2 weeks ago

I will look into this issue. If I have any doubts , can I ask them here?

Madraceee commented 2 weeks ago

If my understanding is right, For each algo(token Bucket, leaky bucket etc), I need to write another function similar to Limit which resets the state of the backend?

mennanov commented 2 weeks ago

Right. You will also need to add tests for each of them in a similar way it's done for the Limit() method