MCPcopy
hub / github.com/netbirdio/netbird / writeJSON

Method writeJSON

proxy/internal/debug/handler.go:953–960  ·  view source on GitHub ↗
(w http.ResponseWriter, v any)

Source from the content-addressed store, hash-verified

951}
952
953func (h *Handler) writeJSON(w http.ResponseWriter, v any) {
954 w.Header().Set("Content-Type", "application/json")
955 enc := json.NewEncoder(w)
956 enc.SetIndent("", " ")
957 if err := enc.Encode(v); err != nil {
958 h.logger.Errorf("encode JSON response: %v", err)
959 }
960}

Callers 10

handleIndexMethod · 0.95
handleListClientsMethod · 0.95
handleClientStatusMethod · 0.95
handlePingTCPMethod · 0.95
handleLogLevelMethod · 0.95
handleClientStartMethod · 0.95
handleClientStopMethod · 0.95
handlePerfMethod · 0.95
handleRuntimeMethod · 0.95
handleHealthMethod · 0.95

Calls 3

ErrorfMethod · 0.80
SetMethod · 0.65
HeaderMethod · 0.45

Tested by

no test coverage detected