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

Method prepareDefaultCtx

ctx_interface.go:105–117  ·  view source on GitHub ↗
(rawCtx any, fctx *fasthttp.RequestCtx)

Source from the content-addressed store, hash-verified

103}
104
105func (*App) prepareDefaultCtx(rawCtx any, fctx *fasthttp.RequestCtx) (*DefaultCtx, bool) {
106 ctx, ok := rawCtx.(*DefaultCtx)
107 if !ok {
108 if _, ok := rawCtx.(CustomCtx); ok {
109 return nil, false
110 }
111 panic(errDefaultCtxTypeAssertion)
112 }
113
114 ctx.Reset(fctx)
115
116 return ctx, true
117}
118
119// ReleaseCtx releases the ctx back into the pool.
120// If the context was abandoned (e.g., by timeout middleware), this is a no-op.

Calls 1

ResetMethod · 0.65