Skip to content

Commit

Permalink
Rename k1LoW to 2manymws
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed Dec 15, 2023
1 parent 083f1b1 commit 8a14c04
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 18 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# rl [![Go Reference](https://pkg.go.dev/badge/github.com/k1LoW/rl.svg)](https://pkg.go.dev/github.com/k1LoW/rl) [![build](https://github.com/k1LoW/rl/actions/workflows/ci.yml/badge.svg)](https://github.com/k1LoW/rl/actions/workflows/ci.yml) ![Coverage](https://raw.githubusercontent.com/k1LoW/octocovs/main/badges/k1LoW/rl/coverage.svg) ![Code to Test Ratio](https://raw.githubusercontent.com/k1LoW/octocovs/main/badges/k1LoW/rl/ratio.svg) ![Test Execution Time](https://raw.githubusercontent.com/k1LoW/octocovs/main/badges/k1LoW/rl/time.svg)
# rl [![Go Reference](https://pkg.go.dev/badge/github.com/2manymws/rl.svg)](https://pkg.go.dev/github.com/2manymws/rl) [![build](https://github.com/2manymw/rl/actions/workflows/ci.yml/badge.svg)](https://github.com/2manymw/rl/actions/workflows/ci.yml) ![Coverage](https://raw.githubusercontent.com/k1LoW/octocovs/main/badges/k1LoW/rl/coverage.svg) ![Code to Test Ratio](https://raw.githubusercontent.com/k1LoW/octocovs/main/badges/k1LoW/rl/ratio.svg) ![Test Execution Time](https://raw.githubusercontent.com/k1LoW/octocovs/main/badges/k1LoW/rl/time.svg)

`rl` is a **r**ate **l**imit middleware for multiple limit rules.

## Usage

Prepare an instance that implements [`rl.Limiter`](https://pkg.go.dev/github.com/k1LoW/rl#Limiter) interface.
Prepare an instance that implements [`rl.Limiter`](https://pkg.go.dev/github.com/2manymws/rl#Limiter) interface.

Then, generate the middleware ( `func(next http.Handler) http.Handler` ) with [`rl.New`](https://pkg.go.dev/github.com/k1LoW/rl#New)
Then, generate the middleware ( `func(next http.Handler) http.Handler` ) with [`rl.New`](https://pkg.go.dev/github.com/2manymws/rl#New)

```go
package main
Expand All @@ -15,7 +15,7 @@ import (
"log"
"net/http"

"github.com/k1LoW/rl"
"github.com/2manymw/rl"
)

func main() {
Expand Down
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/k1LoW/rl
module github.com/2manymws/rl

go 1.21.0

Expand Down
4 changes: 2 additions & 2 deletions rl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"testing"

"github.com/go-chi/httprate"
"github.com/k1LoW/rl"
"github.com/k1LoW/rl/testutil"
"github.com/2manymw/rl"
"github.com/2manymw/rl/testutil"
)

var _ rl.Limiter = (*testutil.Limiter)(nil)
Expand Down
9 changes: 2 additions & 7 deletions testdata/go_test.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
module github.com/k1LoW/rl
module github.com/2manymws/rl

go 1.21.0

require (
github.com/go-chi/httprate v0.7.4
golang.org/x/sync v0.3.0
)

require github.com/cespare/xxhash/v2 v2.1.2 // indirect
require golang.org/x/sync v0.5.0
2 changes: 1 addition & 1 deletion testdata/testbin/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/k1LoW/rl/testdata/testbin
module github.com/2manymw/rl/testdata/testbin

go 1.21.1

Expand Down
4 changes: 2 additions & 2 deletions testdata/testbin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"strconv"

"github.com/go-chi/httprate"
"github.com/k1LoW/rl"
"github.com/k1LoW/rl/testutil"
"github.com/2manymw/rl"
"github.com/2manymw/rl/testutil"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion testutil/limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"github.com/go-chi/httprate"
"github.com/k1LoW/rl"
"github.com/2manymw/rl"
)

type Limiter struct {
Expand Down

0 comments on commit 8a14c04

Please sign in to comment.