FromContext returns the PageInfo from the request context. It accepts fiber.CustomCtx, fiber.Ctx, *fasthttp.RequestCtx, and context.Context. Returns nil and false if no PageInfo is stored.
(ctx any)
| 90 | // It accepts fiber.CustomCtx, fiber.Ctx, *fasthttp.RequestCtx, and context.Context. |
| 91 | // Returns nil and false if no PageInfo is stored. |
| 92 | func FromContext(ctx any) (*PageInfo, bool) { |
| 93 | return fiber.ValueFromContext[*PageInfo](ctx, pageInfoKey) |
| 94 | } |
| 95 | |
| 96 | func parseSortQuery(query string, allowedSorts []string, defaultSort string) []SortField { |
| 97 | if query == "" { |
no outgoing calls