MCPcopy Create free account
hub / github.com/kataras/iris / handleMany

Method handleMany

mvc/controller.go:491–511  ·  view source on GitHub ↗
(method, path, funcName string, override bool, middleware ...context.Handler)

Source from the content-addressed store, hash-verified

489}
490
491func (c *ControllerActivator) handleMany(method, path, funcName string, override bool, middleware ...context.Handler) []*router.Route {
492 if method == "" || path == "" || funcName == "" ||
493 (c.isReservedMethod(funcName) && c.isReservedMethodHandler(method, path)) {
494 // isReservedMethod -> if it's already registered
495 // by a previous Handle or analyze methods internally.
496 return nil
497 }
498
499 handler := c.handlerOf(path, funcName)
500 middleware = context.JoinHandlers(c.BeginHandlers, middleware)
501
502 // register the handler now.
503 routes := c.app.Router.HandleMany(method, path, append(middleware, handler)...)
504 if routes == nil {
505 c.logErrorf("MVC: unable to register a route for the path for '%s.%s'", c.fullName, funcName)
506 return nil
507 }
508
509 c.saveRoutes(funcName, routes, override)
510 return routes
511}
512
513func (c *ControllerActivator) saveRoutes(funcName string, routes []*router.Route, override bool) {
514 m, ok := c.Type.MethodByName(funcName)

Callers 2

HandleMethod · 0.95
HandleManyMethod · 0.95

Calls 7

isReservedMethodMethod · 0.95
handlerOfMethod · 0.95
logErrorfMethod · 0.95
saveRoutesMethod · 0.95
JoinHandlersFunction · 0.92
HandleManyMethod · 0.65

Tested by

no test coverage detected