зеркало из https://github.com/golang/build.git
gerrit: Add GetAccountInfo
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:
Родитель
1d862e84f2
Коммит
482b2ecd51
|
@ -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",
|
||||
|
|
Загрузка…
Ссылка в новой задаче