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

Function deleteGPGKey

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

Source from the content-addressed store, hash-verified

13}
14
15func deleteGPGKey(httpClient *http.Client, host, id string) error {
16 path, err := safeurl.JoinPath("user", "gpg_keys", id)
17 if err != nil {
18 return err
19 }
20 // TODO(api-client-rollout)
21 // This line of code is part of a mechanical roll out of the api client.
22 // As a follow up, consider whether the api client can be injected to this call site, rather than constructed
23 return api.NewClientFromHTTP(httpClient).REST(host, "DELETE", path.String(), nil, nil)
24}
25
26func getGPGKeys(httpClient *http.Client, host string) ([]gpgKey, error) {
27 u, err := safeurl.JoinPath("user", "gpg_keys")

Callers 2

deleteRunFunction · 0.85

Calls 4

JoinPathFunction · 0.92
NewClientFromHTTPFunction · 0.92
RESTMethod · 0.65
StringMethod · 0.65

Tested by 1