Test_Limiter_With_Max_Func_With_Zero() — fiber Function Reference
Architecture documentation for the Test_Limiter_With_Max_Func_With_Zero() function in limiter_test.go from the fiber codebase.
Entity Profile
Dependency Diagram
graph TD bb182ea4_22db_c929_8a03_1ba7c11f613c["Test_Limiter_With_Max_Func_With_Zero()"] 0509da96_221e_0d0d_fe2e_f2e2e3695b6f["limiter_test.go"] bb182ea4_22db_c929_8a03_1ba7c11f613c -->|defined in| 0509da96_221e_0d0d_fe2e_f2e2e3695b6f style bb182ea4_22db_c929_8a03_1ba7c11f613c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
middleware/limiter/limiter_test.go lines 572–607
func Test_Limiter_With_Max_Func_With_Zero(t *testing.T) {
t.Parallel()
app := fiber.New()
app.Use(New(Config{
MaxFunc: func(_ fiber.Ctx) int {
return 0
},
Expiration: 2 * time.Second,
Storage: memory.New(),
}))
app.Get("/", func(c fiber.Ctx) error {
return c.SendString("Hello tester!")
})
var wg sync.WaitGroup
for i := 0; i <= 4; i++ {
wg.Go(func() {
resp, err := app.Test(httptest.NewRequest(fiber.MethodGet, "/", http.NoBody))
require.NoError(t, err)
assert.Equal(t, fiber.StatusOK, resp.StatusCode)
body, err := io.ReadAll(resp.Body)
require.NoError(t, err)
assert.Equal(t, "Hello tester!", string(body))
})
}
wg.Wait()
resp, err := app.Test(httptest.NewRequest(fiber.MethodGet, "/", http.NoBody))
require.NoError(t, err)
require.Equal(t, 200, resp.StatusCode)
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does Test_Limiter_With_Max_Func_With_Zero() do?
Test_Limiter_With_Max_Func_With_Zero() is a function in the fiber codebase, defined in middleware/limiter/limiter_test.go.
Where is Test_Limiter_With_Max_Func_With_Zero() defined?
Test_Limiter_With_Max_Func_With_Zero() is defined in middleware/limiter/limiter_test.go at line 572.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free