MCPcopy Create free account
hub / github.com/cli/cli / do

Method do

internal/codespaces/api/api.go:1278–1290  ·  view source on GitHub ↗

do executes the given request and returns the response. It creates an opentracing span to track the length of the request.

(ctx context.Context, req *http.Request, spanName string)

Source from the content-addressed store, hash-verified

1276// do executes the given request and returns the response. It creates an
1277// opentracing span to track the length of the request.
1278func (a *API) do(ctx context.Context, req *http.Request, spanName string) (*http.Response, error) {
1279 // TODO(adonovan): use NewRequestWithContext(ctx) and drop ctx parameter.
1280 span, ctx := opentracing.StartSpanFromContext(ctx, spanName)
1281 defer span.Finish()
1282 req = req.WithContext(ctx)
1283
1284 httpClient, err := a.client()
1285 if err != nil {
1286 return nil, err
1287 }
1288
1289 return httpClient.Do(req)
1290}
1291
1292// setHeaders sets the required headers for the API.
1293func (a *API) setHeaders(req *http.Request) {

Callers 15

GetUserMethod · 0.95
GetRepositoryMethod · 0.95
ListCodespacesMethod · 0.95
GetOrgMemberCodespaceMethod · 0.95
GetCodespaceMethod · 0.95
StartCodespaceMethod · 0.95
StopCodespaceMethod · 0.95
GetCodespacesMachinesMethod · 0.95
startCreateMethod · 0.95

Calls 1

DoMethod · 0.65

Tested by

no test coverage detected