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)
| 843 | // It is used internally by NewWithCustomCtx. It doesn't allow adding new methods, |
| 844 | // only customizing existing ones. |
| 845 | func (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. |
| 855 | func (app *App) RegisterCustomConstraint(constraint CustomConstraint) { |
no test coverage detected