Example #1
0
// HandleSubrouter uses the subrouter for a specific calls and creates a tree of sorts
// handling each route with a different subrouter
func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler) {
	s.Methods("GET").
		Path("/operations_profiles").
		Name("List Operations Profiles").
		Handler(confhandler.Respond(List))

	s.Methods("GET").
		Path("/operations_profiles/{ID}").
		Name("List One Operations Profile").
		Handler(confhandler.Respond(ListOne))

	s.Methods("POST").
		Path("/operations_profiles").
		Name("Create Operations Profile").
		Handler(confhandler.Respond(Create))

	s.Methods("PUT").
		Path("/operations_profiles/{ID}").
		Name("Update Operations Profile").
		Handler(confhandler.Respond(Update))

	s.Methods("DELETE").
		Path("/operations_profiles/{ID}").
		Name("Delete Operations Profile").
		Handler(confhandler.Respond(Delete))
}
Example #2
0
// HandleSubrouter uses the subrouter for a specific calls and creates a tree of sorts
// handling each route with a different subrouter
func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler) {
	s.Methods("POST").Path("/reports").Handler(confhandler.Respond(Create))
	s.Methods("PUT").Path("/reports/{id}").Handler(confhandler.Respond(Update))
	s.Methods("DELETE").Path("/reports/{id}").Handler(confhandler.Respond(Delete))
	s.Methods("GET").Path("/reports/{id}").Handler(confhandler.Respond(ListOne))
	s.Methods("GET").Path("/reports").Handler(confhandler.Respond(List))
}
Example #3
0
// HandleSubrouter uses the subrouter for a specific calls and creates a tree of sorts
// handling each route with a different subrouter
func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler) {
	s.Methods("GET").
		Path("/recomputations/{ID}").
		Name("List Single Recomputation").
		Handler(confhandler.Respond(ListOne))

	// strictRoute := s.MatcherFunc(respond.MatchRegex("^" + confhandler.Routes.V2["recomputations"] + "$")).Subrouter()

	s.Methods("GET").
		Path("/recomputations").
		Name("List Recomputations").
		Handler(confhandler.Respond(List))

	s.Methods("POST").
		Path("/recomputations").
		Name("Recomputations").
		Handler(confhandler.Respond(SubmitRecomputation))
}
Example #4
0
func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler) {
	s.Methods("GET").
		Name("List Factors").
		Handler(confhandler.Respond(List))
}