MCPcopy Index your code
hub / github.com/google/go-github / fetchMetricsReport

Method fetchMetricsReport

github/copilot.go:1142–1159  ·  view source on GitHub ↗

fetchMetricsReport performs a GET against the provided download URL and returns the raw http.Response. The caller is responsible for closing the body.

(ctx context.Context, url string)

Source from the content-addressed store, hash-verified

1140// fetchMetricsReport performs a GET against the provided download URL and returns the raw
1141// http.Response. The caller is responsible for closing the body.
1142func (s *CopilotService) fetchMetricsReport(ctx context.Context, url string) (*http.Response, *Response, error) {
1143 req, err := http.NewRequestWithContext(ctx, "GET", url, nil)
1144 if err != nil {
1145 return nil, nil, err
1146 }
1147
1148 resp, err := s.client.client.Do(req)
1149 if err != nil {
1150 return nil, nil, err
1151 }
1152
1153 if err := CheckResponse(resp); err != nil {
1154 resp.Body.Close()
1155 return nil, newResponse(resp), err
1156 }
1157
1158 return resp, newResponse(resp), nil
1159}
1160
1161// decodeNDJSONMetrics streams a newline-delimited JSON response body into a slice of *T,
1162// returning a nil slice when the body is empty.

Callers 4

DownloadDailyMetricsMethod · 0.95

Calls 4

CheckResponseFunction · 0.85
newResponseFunction · 0.85
CloseMethod · 0.80
DoMethod · 0.45

Tested by

no test coverage detected