MCPcopy Create free account
hub / github.com/docker/cli / writeResponse

Function writeResponse

internal/registry/registry_mock_test.go:52–61  ·  view source on GitHub ↗
(w http.ResponseWriter, message any, code int)

Source from the content-addressed store, hash-verified

50}
51
52func writeResponse(w http.ResponseWriter, message any, code int) {
53 writeHeaders(w)
54 w.WriteHeader(code)
55 body, err := json.Marshal(message)
56 if err != nil {
57 _, _ = io.WriteString(w, err.Error())
58 return
59 }
60 _, _ = w.Write(body)
61}
62
63func handlerGetPing(w http.ResponseWriter, r *http.Request) {
64 if r.Method != http.MethodGet {

Callers 2

handlerGetPingFunction · 0.85
handlerSearchFunction · 0.85

Calls 3

writeHeadersFunction · 0.85
ErrorMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…