MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / writeJSON

Function writeJSON

internal/server/server.go:2934–2939  ·  view source on GitHub ↗
(w http.ResponseWriter, status int, v interface{})

Source from the content-addressed store, hash-verified

2932}
2933
2934func writeJSON(w http.ResponseWriter, status int, v interface{}) {
2935 w.WriteHeader(status)
2936 if err := json.NewEncoder(w).Encode(v); err != nil {
2937 slog.Error("failed to encode JSON response", "error", err)
2938 }
2939}
2940
2941// Messages of the retryable "database busy" answer (TASK-4278). A write whose
2942// transaction definitely rolled back (store.IsDBBusy: the server said so) says

Callers 15

handleServerIdentityMethod · 0.85
handleGetItemBuiltinMethod · 0.85
handleImportURLMethod · 0.85
handleItemsSortOrderMethod · 0.85
handleListMembersMethod · 0.85
handleInviteMemberMethod · 0.85

Calls 3

EncodeMethod · 0.65
WriteHeaderMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected