MCPcopy Index your code
hub / github.com/cli/cli / do

Method do

internal/codespaces/api/api.go:1184–1196  ·  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

1182// do executes the given request and returns the response. It creates an
1183// opentracing span to track the length of the request.
1184func (a *API) do(ctx context.Context, req *http.Request, spanName string) (*http.Response, error) {
1185 // TODO(adonovan): use NewRequestWithContext(ctx) and drop ctx parameter.
1186 span, ctx := opentracing.StartSpanFromContext(ctx, spanName)
1187 defer span.Finish()
1188 req = req.WithContext(ctx)
1189
1190 httpClient, err := a.client()
1191 if err != nil {
1192 return nil, err
1193 }
1194
1195 return httpClient.Do(req)
1196}
1197
1198// setHeaders sets the required headers for the API.
1199func (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