func (h *handlerConfiguration) createShootingUserHandler(prefix string) handler_finder.HandlerFinder { hf := part.New(prefix) hf.RegisterHandler("/list", h.nocache(h.handle_errors(h.check_permission(booking_shooting_user_list_handler.New(h.userService.ListUserOfShooting), booking_authorization.Organizer)))) hf.RegisterHandler("/add", h.nocache(h.handle_errors(h.check_permission(booking_shooting_user_add_handler.New(h.shootingUserService.Add, h.protocoller.AddProtocol), booking_authorization.Organizer)))) hf.RegisterHandler("/remove", h.nocache(h.handle_errors(h.check_permission(booking_shooting_user_remove_handler.New(h.shootingUserService.Remove, h.protocoller.AddProtocol), booking_authorization.Organizer)))) return hf }
func NewHandler(documentRoot string) http.Handler { glog.V(2).Infof("root: %s", documentRoot) fileServer := cacheheader.New(contenttype.New(http.FileServer(http.Dir(documentRoot)))) handlerFinder := part.New("") handlerFinder.RegisterHandler("/", fileServer) handlerFinder.RegisterHandler("/css", fileServer) handlerFinder.RegisterHandler("/js", fileServer) handlerFinder.RegisterHandler("/images", fileServer) return log_handler.New(fallback.New(handlerFinder, static.NewWithReturnCode("not found", 404))) }
func (h *handlerConfiguration) GetHandler() http.Handler { glog.V(2).Infof("root: %s", h.documentRoot) fileServer := cacheheader.New(contenttype.New(http.FileServer(http.Dir(h.documentRoot)))) handlerFinder := part.New("") handlerFinder.RegisterHandler("/", fileServer) handlerFinder.RegisterHandler("/css", fileServer) handlerFinder.RegisterHandler("/js", fileServer) handlerFinder.RegisterHandler("/images", fileServer) handlerFinder.RegisterHandler("/status", h.handle_errors(booking_status_handler.New())) handlerFinder.RegisterHandler("/calendar", h.handle_errors(booking_calendar_handler.New(h.calendarWriter.WriteCalendar, h.configService.GetStringDefault))) handlerFinder.RegisterHandlerFinder("/date", h.createDateHandlerFinder("/date")) handlerFinder.RegisterHandlerFinder("/model", h.createModelHandlerFinder("/model")) handlerFinder.RegisterHandlerFinder("/shooting", h.createShootingHandlerFinder("/shooting")) handlerFinder.RegisterHandlerFinder("/user", h.createUserHandlerFinder("/user")) handlerFinder.RegisterHandlerFinder("/config", h.createConfigHandlerFinder("/config")) handlerFinder.RegisterHandlerFinder("/authentication", h.createAuthenticationHandlerFinder("/authentication")) handlerFinder.RegisterHandlerFinder("/date_user", h.createDateUserHandler("/date_user")) handlerFinder.RegisterHandlerFinder("/shooting_user", h.createShootingUserHandler("/shooting_user")) return log_handler.New(fallback.New(handlerFinder, static.NewWithReturnCode("not found", 404))) }
func (h *handlerConfiguration) createAuthenticationHandlerFinder(prefix string) handler_finder.HandlerFinder { hf := part.New(prefix) hf.RegisterHandler("/verifyLogin", h.handle_errors(h.check_permission(booking_authentication_handler_verifylogin.New(h.authenticationService.VerifyLogin), booking_authorization.None))) return hf }