示例#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))
}
示例#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))
}
示例#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))
}
示例#4
0
func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler) {
	s.Methods("GET").
		Name("List Factors").
		Handler(confhandler.Respond(List))
}