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

Function RepoLicenses

api/queries_repo.go:1690–1698  ·  view source on GitHub ↗

RepoLicenses fetches available repository licenses. It uses API v3 because licenses are not supported by GraphQL.

(httpClient *http.Client, hostname string)

Source from the content-addressed store, hash-verified

1688// RepoLicenses fetches available repository licenses.
1689// It uses API v3 because licenses are not supported by GraphQL.
1690func RepoLicenses(httpClient *http.Client, hostname string) ([]License, error) {
1691 var licenses []License
1692 client := NewClientFromHTTP(httpClient)
1693 err := client.REST(hostname, "GET", "licenses", nil, &licenses)
1694 if err != nil {
1695 return nil, err
1696 }
1697 return licenses, nil
1698}
1699
1700// RepoLicense fetches an available repository license.
1701// It uses API v3 because licenses are not supported by GraphQL.

Callers 4

listRunFunction · 0.92
NewCmdCreateFunction · 0.92
interactiveLicenseFunction · 0.92

Calls 2

NewClientFromHTTPFunction · 0.85
RESTMethod · 0.65

Tested by 1