MCPcopy
hub / github.com/multica-ai/multica / writeJSON

Function writeJSON

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

Source from the content-addressed store, hash-verified

255}
256
257func writeJSON(w http.ResponseWriter, status int, v any) {
258 w.Header().Set("Content-Type", "application/json")
259 w.WriteHeader(status)
260 json.NewEncoder(w).Encode(v)
261}
262
263// writeMeasuredJSON behaves like writeJSON but returns the encoded body size so
264// callers can record payload bytes in slow-endpoint diagnostics. It measures the

Callers 15

InitiateListModelsMethod · 0.70
GetModelListRequestMethod · 0.70
ReportModelListResultMethod · 0.70
DaemonRegisterMethod · 0.70
DaemonDeregisterMethod · 0.70
DaemonHeartbeatMethod · 0.70
StartTaskMethod · 0.70

Calls 1

SetMethod · 0.45