MCPcopy Create free account
hub / github.com/cortexproject/cortex / UnmarshalResponse

Function UnmarshalResponse

pkg/querier/tripperware/query.go:800–811  ·  view source on GitHub ↗
(r *http.Response, buf []byte, resp *PrometheusResponse)

Source from the content-addressed store, hash-verified

798}
799
800func UnmarshalResponse(r *http.Response, buf []byte, resp *PrometheusResponse) error {
801 if r.Header == nil {
802 return json.Unmarshal(buf, resp)
803 }
804
805 contentType := r.Header.Get("Content-Type")
806 if contentType == ApplicationProtobuf || contentType == QueryResponseCortexMIMEType {
807 return proto.Unmarshal(buf, resp)
808 } else {
809 return json.Unmarshal(buf, resp)
810 }
811}

Callers 2

DecodeResponseMethod · 0.92
DecodeResponseMethod · 0.92

Calls 2

GetMethod · 0.65
UnmarshalMethod · 0.45

Tested by

no test coverage detected