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

Function getGPGKeys

pkg/cmd/gpg-key/delete/http.go:26–42  ·  view source on GitHub ↗
(httpClient *http.Client, host string)

Source from the content-addressed store, hash-verified

24}
25
26func getGPGKeys(httpClient *http.Client, host string) ([]gpgKey, error) {
27 u, err := safeurl.JoinPath("user", "gpg_keys")
28 if err != nil {
29 return nil, err
30 }
31 u.SetQuery("per_page", "100")
32
33 var keys []gpgKey
34 // TODO(api-client-rollout)
35 // This line of code is part of a mechanical roll out of the api client.
36 // As a follow up, consider whether the api client can be injected to this call site, rather than constructed
37 err = api.NewClientFromHTTP(httpClient).REST(host, "GET", u.String(), nil, &keys)
38 if err != nil {
39 return nil, err
40 }
41 return keys, nil
42}

Callers 2

deleteRunFunction · 0.85
Test_getGPGKeysHTTPErrorFunction · 0.85

Calls 5

JoinPathFunction · 0.92
NewClientFromHTTPFunction · 0.92
SetQueryMethod · 0.80
RESTMethod · 0.65
StringMethod · 0.65

Tested by 1

Test_getGPGKeysHTTPErrorFunction · 0.68