refactor: make pmapi.Client the interface

This commit is contained in:
James Houlahan
2020-04-06 16:02:37 +02:00
parent 6e38a65bd8
commit f269be4291
34 changed files with 806 additions and 856 deletions

View File

@ -92,7 +92,7 @@ func (u *User) KeyRing() *pmcrypto.KeyRing {
}
// UpdateUser retrieves details about user and loads its addresses.
func (c *Client) UpdateUser() (user *User, err error) {
func (c *client) UpdateUser() (user *User, err error) {
req, err := c.NewRequest("GET", "/users", nil)
if err != nil {
return
@ -122,7 +122,7 @@ func (c *Client) UpdateUser() (user *User, err error) {
}
// CurrentUser returns currently active user or user will be updated.
func (c *Client) CurrentUser() (user *User, err error) {
func (c *client) CurrentUser() (user *User, err error) {
if c.user != nil && len(c.addresses) != 0 {
user = c.user
return