Add missing ListGPGKeys of a user (#44)

This commit is contained in:
Antoine GIRARD 2017-03-09 02:32:59 +01:00 committed by Lunny Xiao
parent 8807a1d2ce
commit 4878372177

View file

@ -38,6 +38,12 @@ type CreateGPGKeyOption struct {
ArmoredKey string `json:"armored_public_key" binding:"Required"` ArmoredKey string `json:"armored_public_key" binding:"Required"`
} }
// ListGPGKeys list all the GPG keys of the user
func (c *Client) ListGPGKeys(user string) ([]*GPGKey, error) {
keys := make([]*GPGKey, 0, 10)
return keys, c.getParsedResponse("GET", fmt.Sprintf("/users/%s/gpg_keys", user), nil, nil, &keys)
}
// ListMyGPGKeys list all the GPG keys of current user // ListMyGPGKeys list all the GPG keys of current user
func (c *Client) ListMyGPGKeys() ([]*GPGKey, error) { func (c *Client) ListMyGPGKeys() ([]*GPGKey, error) {
keys := make([]*GPGKey, 0, 10) keys := make([]*GPGKey, 0, 10)