MCPcopy Index your code
hub / github.com/cortexlabs/cortex / GetAPI

Function GetAPI

pkg/operator/endpoints/get.go:36–46  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

34}
35
36func GetAPI(w http.ResponseWriter, r *http.Request) {
37 apiName := mux.Vars(r)["apiName"]
38
39 response, err := resources.GetAPI(apiName)
40 if err != nil {
41 respondError(w, r, err)
42 return
43 }
44
45 respondJSON(w, r, response)
46}
47
48func GetAPIByID(w http.ResponseWriter, r *http.Request) {
49 apiName := mux.Vars(r)["apiName"]

Callers

nothing calls this directly

Calls 3

GetAPIFunction · 0.92
respondErrorFunction · 0.85
respondJSONFunction · 0.70

Tested by

no test coverage detected