MCPcopy Create free account
hub / github.com/InferCore/InferCore / writeJSON

Function writeJSON

internal/server/server.go:656–660  ·  view source on GitHub ↗
(w http.ResponseWriter, status int, v any)

Source from the content-addressed store, hash-verified

654}
655
656func writeJSON(w http.ResponseWriter, status int, v any) {
657 w.Header().Set("Content-Type", "application/json")
658 w.WriteHeader(status)
659 _ = json.NewEncoder(w).Encode(v)
660}
661
662func writeError(w http.ResponseWriter, status int, requestID, code, message string) {
663 writeJSON(w, status, map[string]any{

Callers 4

healthMethod · 0.85
statusMethod · 0.85
writeAIResponseMethod · 0.85
writeErrorFunction · 0.85

Calls 1

WriteHeaderMethod · 0.80

Tested by

no test coverage detected