MCPcopy Create free account
hub / github.com/docker/go-plugins-helpers / StreamResponse

Function StreamResponse

sdk/encoder.go:31–37  ·  view source on GitHub ↗

StreamResponse streams a response object to the client

(w http.ResponseWriter, data io.ReadCloser)

Source from the content-addressed store, hash-verified

29
30// StreamResponse streams a response object to the client
31func StreamResponse(w http.ResponseWriter, data io.ReadCloser) {
32 w.Header().Set("Content-Type", DefaultContentTypeV1_1)
33 if _, err := copyBuf(w, data); err != nil {
34 fmt.Printf("ERROR in stream: %v\n", err)
35 }
36 data.Close()
37}

Callers

nothing calls this directly

Calls 1

copyBufFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…