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

Method setCtxFunc

app.go:845–852  ·  view source on GitHub ↗

setCtxFunc applies the given context factory to the app. It is used internally by NewWithCustomCtx. It doesn't allow adding new methods, only customizing existing ones.

(function func(app *App) CustomCtx)

Source from the content-addressed store, hash-verified

843// It is used internally by NewWithCustomCtx. It doesn't allow adding new methods,
844// only customizing existing ones.
845func (app *App) setCtxFunc(function func(app *App) CustomCtx) {
846 app.newCtxFunc = function
847 app.hasCustomCtx = function != nil
848
849 if app.server != nil {
850 app.server.Handler = app.selectRequestHandler()
851 }
852}
853
854// RegisterCustomConstraint allows to register custom constraint.
855func (app *App) RegisterCustomConstraint(constraint CustomConstraint) {

Callers 1

NewWithCustomCtxFunction · 0.80

Calls 1

selectRequestHandlerMethod · 0.95

Tested by

no test coverage detected