Skip to content

Commit

Permalink
Module Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinBanchio committed Jan 25, 2025
1 parent a44881c commit 642fb77
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/agustinbanchio/rlimit
module github.com/agustinbanchio/go-limit

go 1.23.5

Expand Down
2 changes: 1 addition & 1 deletion interface.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rlimit
package limit

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion leaky_bucket.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rlimit
package limit

import (
"context"
Expand Down
8 changes: 4 additions & 4 deletions leaky_bucket_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package rlimit_test
package limit_test

import (
"github.com/agustinbanchio/rlimit"
"github.com/agustinbanchio/go-limit"
"github.com/stretchr/testify/assert"
"log"
"testing"
Expand All @@ -14,7 +14,7 @@ func TestLeakyBucket_Wait(t *testing.T) {
start := time.Now()

// 5 requests per second
limiter := rlimit.NewLeakyBucket(5, 1*time.Second, 100)
limiter := limit.NewLeakyBucket(5, 1*time.Second, 100)

limiter.Wait()
log.Default().Print(time.Since(start))
Expand All @@ -35,7 +35,7 @@ func TestLeakyBucket_Allow(t *testing.T) {
t.Parallel()

// 5 requests per second
limiter := rlimit.NewLeakyBucket(5, 1*time.Second, 100)
limiter := limit.NewLeakyBucket(5, 1*time.Second, 100)

// 1st request should be allowed
assert.True(t, limiter.Allow())
Expand Down
2 changes: 1 addition & 1 deletion rolling_window.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rlimit
package limit

import (
"context"
Expand Down
8 changes: 4 additions & 4 deletions rolling_window_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package rlimit_test
package limit_test

import (
"github.com/agustinbanchio/rlimit"
"github.com/agustinbanchio/go-limit"
"github.com/stretchr/testify/assert"
"testing"
"time"
Expand All @@ -11,7 +11,7 @@ func TestRollingWindow_Wait(t *testing.T) {
t.Parallel()

// 5 requests per second
limiter := rlimit.NewRollingWindow(5, 1*time.Second)
limiter := limit.NewRollingWindow(5, 1*time.Second)

start := time.Now()
for i := 0; i < 5; i++ {
Expand All @@ -30,7 +30,7 @@ func TestRollingWindow_Allow(t *testing.T) {
t.Parallel()

// 5 requests per second
limiter := rlimit.NewRollingWindow(5, 1*time.Second)
limiter := limit.NewRollingWindow(5, 1*time.Second)

// 5 requests should be allowed
for i := 0; i < 5; i++ {
Expand Down
2 changes: 1 addition & 1 deletion token_bucket.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rlimit
package limit

import (
"context"
Expand Down
8 changes: 4 additions & 4 deletions token_bucket_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package rlimit_test
package limit_test

import (
"github.com/agustinbanchio/rlimit"
"github.com/agustinbanchio/go-limit"
"github.com/stretchr/testify/assert"
"testing"
"time"
Expand All @@ -13,7 +13,7 @@ func TestTokenBucket_Wait(t *testing.T) {
start := time.Now()

// 5 requests per second
limiter := rlimit.NewTokenBucket(5, 1*time.Second)
limiter := limit.NewTokenBucket(5, 1*time.Second)
for i := 0; i < 5; i++ {
limiter.Wait()
}
Expand All @@ -30,7 +30,7 @@ func TestTokenBucket_Allow(t *testing.T) {
t.Parallel()

// 5 requests per second
limiter := rlimit.NewTokenBucket(5, 1*time.Second)
limiter := limit.NewTokenBucket(5, 1*time.Second)

// 5 requests should be allowed
for i := 0; i < 5; i++ {
Expand Down

0 comments on commit 642fb77

Please sign in to comment.