Benchmark_Middleware_Encrypt_Cookie() — fiber Function Reference
Architecture documentation for the Benchmark_Middleware_Encrypt_Cookie() function in encryptcookie_test.go from the fiber codebase.
Entity Profile
Dependency Diagram
graph TD c1e89f49_8553_ea8f_ecd5_a6efd7075f09["Benchmark_Middleware_Encrypt_Cookie()"] ac3bbef3_a1d3_d68b_64fb_619088dde10d["encryptcookie_test.go"] c1e89f49_8553_ea8f_ecd5_a6efd7075f09 -->|defined in| ac3bbef3_a1d3_d68b_64fb_619088dde10d style c1e89f49_8553_ea8f_ecd5_a6efd7075f09 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
middleware/encryptcookie/encryptcookie_test.go lines 420–465
func Benchmark_Middleware_Encrypt_Cookie(b *testing.B) {
testKey := GenerateKey(32)
app := fiber.New()
app.Use(New(Config{
Key: testKey,
}))
app.Get("/", func(c fiber.Ctx) error {
return c.SendString("value=" + c.Cookies("test"))
})
app.Post("/", func(c fiber.Ctx) error {
c.Cookie(&fiber.Cookie{
Name: "test",
Value: "SomeThing",
})
return nil
})
h := app.Handler()
b.Run("Empty Cookie", func(b *testing.B) {
for b.Loop() {
ctx := &fasthttp.RequestCtx{}
ctx.Request.Header.SetMethod(fiber.MethodGet)
h(ctx)
}
})
b.Run("Invalid Cookie", func(b *testing.B) {
for b.Loop() {
ctx := &fasthttp.RequestCtx{}
ctx.Request.Header.SetMethod(fiber.MethodGet)
ctx.Request.Header.SetCookie("test", "Invalid")
h(ctx)
}
})
b.Run("Valid Cookie", func(b *testing.B) {
for b.Loop() {
ctx := &fasthttp.RequestCtx{}
ctx.Request.Header.SetMethod(fiber.MethodPost)
h(ctx)
}
})
}
Domain
Subdomains
Source
Frequently Asked Questions
What does Benchmark_Middleware_Encrypt_Cookie() do?
Benchmark_Middleware_Encrypt_Cookie() is a function in the fiber codebase, defined in middleware/encryptcookie/encryptcookie_test.go.
Where is Benchmark_Middleware_Encrypt_Cookie() defined?
Benchmark_Middleware_Encrypt_Cookie() is defined in middleware/encryptcookie/encryptcookie_test.go at line 420.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free