MCPcopy
hub / github.com/gofiber/fiber / FromContext

Function FromContext

middleware/paginate/paginate.go:92–94  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Calls

no outgoing calls