Skip to content

Releases: Narasimha1997/ratelimiter

v1.1.1

31 Oct 12:08
Compare
Choose a tag to compare

Add benchmarks

v1.1.0

10 Oct 03:17
Compare
Choose a tag to compare

Adds new functions and test cases for these.

  1. func (a *AttributeBasedLimiter) MustShouldAllow(key string, n uint64, limit uint64, size time.Duration) bool
  2. func (a *AttributeBasedLimiter) HasOrCreateKey(key string, limit uint64, size time.Duration) bool

Thanks @fufuok for these contributions.

v1.0.0

03 Oct 09:12
Compare
Choose a tag to compare

Releasing the first initial stable version of rate-limiter.
New additions:

  1. SyncLimiter : A new limiter implementation that require no goroutine in the background to maintain the sliding window.
  2. More tests that cover SyncLimiter.
  3. AttrubuteBasedLimiter can be configured to use DefaultLimiter and SyncLimiter by passing backgroundSlider flag.
  4. Added docs

v0.3.0

30 Sep 18:24
Compare
Choose a tag to compare

New things:

  1. Added test coverage
  2. Fixed an issue that could probably cause deadlock when Kill() is called.
  3. AttributeBasedRateLimiter not accepts string as paramter across various functions instead of *string.

v0.2.0

30 Sep 06:38
Compare
Choose a tag to compare

Additions:

  1. Now we can call defer limiter.Kill() to clean up or deactivate the limiter when it is not in use anymore. This will also kill the underlying goroutine and avoids resource leak.
  2. limiter.ShouldAllow(N uint64) now returns bool, error. error is not nil if ShouldAllow is called on a limiter that is killed or inactive.

v0.1.2

29 Sep 12:28
Compare
Choose a tag to compare

Initial version of ratelimiter.
Test status