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

Function NewDefaultCtx

ctx_interface.go:53–63  ·  view source on GitHub ↗

NewDefaultCtx constructs the default context implementation bound to the provided application.

(app *App)

Source from the content-addressed store, hash-verified

51// NewDefaultCtx constructs the default context implementation bound to the
52// provided application.
53func NewDefaultCtx(app *App) *DefaultCtx {
54 // return ctx
55 ctx := &DefaultCtx{
56 // Set app reference
57 app: app,
58 }
59 ctx.DefaultReq.c = ctx
60 ctx.DefaultRes.c = ctx
61
62 return ctx
63}
64
65// AcquireCtx retrieves a new Ctx from the pool.
66func (app *App) AcquireCtx(fctx *fasthttp.RequestCtx) CustomCtx {

Calls

no outgoing calls