FromContext returns the Middleware from the Fiber context. It accepts fiber.CustomCtx, fiber.Ctx, *fasthttp.RequestCtx, and context.Context. Parameters: - c: The Fiber context. Returns: - *Middleware: The middleware object if found; otherwise, nil. Usage: m := session.FromContext(c)
(ctx any)
| 243 | // |
| 244 | // m := session.FromContext(c) |
| 245 | func FromContext(ctx any) *Middleware { |
| 246 | if m, ok := fiber.ValueFromContext[*Middleware](ctx, middlewareContextKey); ok { |
| 247 | return m |
| 248 | } |
| 249 | |
| 250 | return nil |
| 251 | } |
| 252 | |
| 253 | // Set sets a key-value pair in the session. |
| 254 | // |
no outgoing calls