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

Function getOpsFromGithub

tools/metadata/openapi.go:37–56  ·  view source on GitHub ↗
(ctx context.Context, client *github.Client, gitRef string)

Source from the content-addressed store, hash-verified

35}
36
37func getOpsFromGithub(ctx context.Context, client *github.Client, gitRef string) ([]*operation, error) {
38 descs, err := getDescriptions(ctx, client, gitRef)
39 if err != nil {
40 return nil, err
41 }
42 var ops []*operation
43 for _, desc := range descs {
44 for p, pathItem := range desc.description.Paths.Map() {
45 for method, op := range pathItem.Operations() {
46 docURL := ""
47 if op.ExternalDocs != nil {
48 docURL = op.ExternalDocs.URL
49 }
50 ops = addOperation(ops, desc.filename, method+" "+p, docURL)
51 }
52 }
53 }
54 sortOperations(ops)
55 return ops, nil
56}
57
58func (o *openapiFile) loadDescription(ctx context.Context, client *github.Client, gitRef string) error {
59 contents, resp, err := client.Repositories.DownloadContents(

Callers 1

updateFromGithubMethod · 0.85

Calls 3

getDescriptionsFunction · 0.85
addOperationFunction · 0.85
sortOperationsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…