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

Function writeJSON

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

Source from the content-addressed store, hash-verified

3025}
3026
3027func writeJSON(w http.ResponseWriter, status int, v interface{}) {
3028 w.WriteHeader(status)
3029 if err := json.NewEncoder(w).Encode(v); err != nil {
3030 slog.Error("failed to encode JSON response", "error", err)
3031 }
3032}
3033
3034// Messages of the retryable "database busy" answer (TASK-4278). A write whose
3035// transaction definitely rolled back (store.IsDBBusy: the server said so) says

Callers 15

handleSetRoleParkMethod · 0.85
handleClearRoleParkMethod · 0.85
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