π New
router.Get("/", func(ctx *Context) error {
cookie := Cookie{
Name: "test-cookie-1",
Value: "Test Cookie 1",
Path: "/",
Domain: "localhost",
MaxAge: 0,
Expires: time.Now().Add(24 * time.Hour),
Secure: false,
HTTPOnly: false,
SameSite: "Lax",
SessionOnly: false,
}
ctx.SetCookie(&cookie)
// Get Cookie
ctx.GetCookie("test-cookie-1")
return nil
})
- Support Set / Get Headers
router.Get("/", func(ctx *Context) error {
ctx.SetHeader("test-header", "test header value")
fmt.Println(ctx.GetHeader("test-header"))
return nil
})
- Implement utils in package