MCPcopy Index your code
hub / github.com/google/cadvisor / writeResult

Function writeResult

cmd/internal/api/handler.go:187–197  ·  view source on GitHub ↗
(res interface{}, w http.ResponseWriter)

Source from the content-addressed store, hash-verified

185}
186
187func writeResult(res interface{}, w http.ResponseWriter) error {
188 out, err := json.Marshal(res)
189 if err != nil {
190 return fmt.Errorf("failed to marshall response %+v with error: %s", res, err)
191 }
192
193 w.Header().Set("Content-Type", "application/json")
194 _, err = w.Write(out)
195 return err
196
197}
198
199func streamResults(eventChannel *events.EventChannel, w http.ResponseWriter, r *http.Request, m manager.Manager) error {
200 flusher, ok := w.(http.Flusher)

Callers 6

HandleRequestMethod · 0.85
HandleRequestMethod · 0.85
HandleRequestMethod · 0.85
handleEventRequestFunction · 0.85
HandleRequestMethod · 0.85
HandleRequestMethod · 0.85

Calls 3

ErrorfMethod · 0.80
SetMethod · 0.80
WriteMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…