MCPcopy
hub / github.com/control-theory/gonzo / writeJSON

Function writeJSON

internal/web/server.go:184–189  ·  view source on GitHub ↗
(w http.ResponseWriter, v interface{})

Source from the content-addressed store, hash-verified

182}
183
184func writeJSON(w http.ResponseWriter, v interface{}) {
185 w.Header().Set("Content-Type", "application/json")
186 if err := json.NewEncoder(w).Encode(v); err != nil {
187 log.Printf("Error writing JSON response: %v", err)
188 }
189}
190
191func writeError(w http.ResponseWriter, code int, msg string) {
192 w.Header().Set("Content-Type", "application/json")

Callers 14

handleStatusMethod · 0.85
handleSeverityMethod · 0.85
handleSentimentMethod · 0.85
handlePatternsMethod · 0.85
handleClassesMethod · 0.85
handleLogsMethod · 0.85
handleHeatmapMethod · 0.85
handleAnomaliesMethod · 0.85
handleStreamsMethod · 0.85
handleInsightsParamsMethod · 0.85
handleTopAttributesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected