MCPcopy
hub / github.com/shadow1ng/fscan / writeJSON

Function writeJSON

web/api/scan.go:309–313  ·  view source on GitHub ↗

writeJSON 写入JSON响应

(w http.ResponseWriter, status int, data interface{})

Source from the content-addressed store, hash-verified

307
308// writeJSON 写入JSON响应
309func writeJSON(w http.ResponseWriter, status int, data interface{}) {
310 w.Header().Set("Content-Type", "application/json")
311 w.WriteHeader(status)
312 json.NewEncoder(w).Encode(data)
313}

Callers 12

StartMethod · 0.85
StopMethod · 0.85
StatusMethod · 0.85
ListMethod · 0.85
CreateMethod · 0.85
GetMethod · 0.85
DeleteMethod · 0.85
CacheMethod · 0.85
ListMethod · 0.85
ClearMethod · 0.85
PresetsMethod · 0.85
PluginsMethod · 0.85

Calls 1

WriteHeaderMethod · 0.65

Tested by

no test coverage detected