This implements the get-account Gerrit REST API method.

Change-Id: I5e9e7abaabb3e9c85798f52418fab58447960253
Reviewed-on: https://go-review.googlesource.com/13930
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Rob Earhart 2015-08-25 12:14:23 -07:00 коммит произвёл Brad Fitzpatrick
Родитель 1d862e84f2
Коммит 482b2ecd51
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -324,6 +324,18 @@ func (c *Client) SetReview(changeID, revision string, review ReviewInput) error
nil, review)
}
// GetAccountInfo gets the specified account's information from Gerrit.
// For the API call, see https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#get-account
// The accountID is https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#account-id
//
// Note that getting "self" is a good way to validate host access, since it only requires peeker
// access to the host, not to any particular repository.
func (c *Client) GetAccountInfo(accountID string) (AccountInfo, error) {
var res AccountInfo
err := c.do(&res, "GET", fmt.Sprintf("/accounts/%s", accountID), nil, nil)
return res, err
}
type TimeStamp time.Time
// Gerrit's timestamp layout is like time.RFC3339Nano, but with a space instead of the "T",