MCPcopy
hub / github.com/cortexlabs/cortex / respondJSON

Function respondJSON

pkg/async-gateway/endpoint.go:130–134  ·  view source on GitHub ↗
(w http.ResponseWriter, statusCode int, s interface{})

Source from the content-addressed store, hash-verified

128}
129
130func respondJSON(w http.ResponseWriter, statusCode int, s interface{}) error {
131 w.Header().Set("Content-Type", "application/json")
132 w.WriteHeader(statusCode)
133 return json.NewEncoder(w).Encode(s)
134}
135
136func logErrorWithTelemetry(log *zap.SugaredLogger, err error) {
137 telemetry.Error(err)

Callers 2

CreateWorkloadMethod · 0.70
GetWorkloadMethod · 0.70

Calls 1

SetMethod · 0.80

Tested by

no test coverage detected