MCPcopy Create free account
hub / github.com/bodaay/HuggingFaceModelDownloader / writeJSON

Function writeJSON

internal/server/api.go:549–553  ·  view source on GitHub ↗

--- Helpers ---

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

Source from the content-addressed store, hash-verified

547// --- Helpers ---
548
549func writeJSON(w http.ResponseWriter, status int, data any) {
550 w.Header().Set("Content-Type", "application/json")
551 w.WriteHeader(status)
552 json.NewEncoder(w).Encode(data)
553}
554
555func writeError(w http.ResponseWriter, status int, message, details string) {
556 writeJSON(w, status, ErrorResponse{

Callers 15

handleHealthMethod · 0.85
handleStartDownloadMethod · 0.85
handlePlanInternalMethod · 0.85
handleListJobsMethod · 0.85
handleGetJobMethod · 0.85
handleCancelJobMethod · 0.85
handlePauseJobMethod · 0.85
handleResumeJobMethod · 0.85
handleDismissJobMethod · 0.85
handleGetSettingsMethod · 0.85
handleUpdateSettingsMethod · 0.85
writeErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected