Skip to content

Commit e9877ed

Browse files
docs: adjust example limiter
1 parent 440fce7 commit e9877ed

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

middleware/limiter/limiter_example_test.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ func ExampleRateLimiter() {
3535

3636
// Simulate multiple requests to test rate limiting
3737
for i := 0; i < 5; i++ { // Enviar mais requisições que o limite (3)
38-
res, _ := q.QuickTest("GET", "/", nil)
38+
res, _ := q.Qtest(quick.QuickTestOptions{
39+
Method: quick.MethodGet,
40+
URI: "/",
41+
})
3942
fmt.Println(res.BodyStr())
4043
}
4144

@@ -102,7 +105,10 @@ func ExampleRateLimiter_group() {
102105

103106
// Functionality test using QuickTest (simulates a request for the protected route)
104107
for i := 0; i < 5; i++ { // Send more requests than the limit (3) to test the block
105-
res, _ := q.QuickTest("GET", "/v1/users", nil)
108+
res, _ := q.Qtest(quick.QuickTestOptions{
109+
Method: quick.MethodGet,
110+
URI: "/v1/users",
111+
})
106112
fmt.Println(res.BodyStr())
107113
}
108114

0 commit comments

Comments
 (0)