MCPcopy
hub / github.com/nextlevelbuilder/goclaw / writeJSON

Function writeJSON

internal/http/response_helpers.go:42–46  ·  view source on GitHub ↗

writeJSON writes a JSON response with the given status code. Used for success responses and legacy error responses during migration.

(w http.ResponseWriter, status int, data any)

Source from the content-addressed store, hash-verified

40// writeJSON writes a JSON response with the given status code.
41// Used for success responses and legacy error responses during migration.
42func writeJSON(w http.ResponseWriter, status int, data any) {
43 w.Header().Set("Content-Type", "application/json")
44 w.WriteHeader(status)
45 json.NewEncoder(w).Encode(data)
46}

Callers 15

handleAggregateMethod · 0.85
handleStatusMethod · 0.85
handleStartMethod · 0.85
handleManualCallbackMethod · 0.85
handleLogoutMethod · 0.85
handleMethod · 0.85
handlePreflightMethod · 0.85
handleListMethod · 0.85
handleSizeMethod · 0.85
handleReadMethod · 0.85
handleDeleteMethod · 0.85

Calls 1

SetMethod · 0.65

Tested by

no test coverage detected