-
Notifications
You must be signed in to change notification settings - Fork 53
Conversation
LGTM |
@@ -10,6 +10,29 @@ import ( | |||
"fmt" | |||
) | |||
|
|||
// ListCollaborators list a repository's collaborators | |||
func (c *Client) ListCollaborators(user, repo string) ([]*User, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pager?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs pagination yes, I must've missed that one 🙁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO pager makes only sense for potentially large lists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's OKay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tboerger having 100 collaborators isn't large enough? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and seeing as it's currently locked at 10 entries per call, pagination is required if you have more than that...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100 is nothing for an api ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree pager is no need currently. But collaborators := make([]*User, 0, 10)
is really not collaborators := make([]*User, 10)
.
@@ -10,6 +10,29 @@ import ( | |||
"fmt" | |||
) | |||
|
|||
// ListCollaborators list a repository's collaborators | |||
func (c *Client) ListCollaborators(user, repo string) ([]*User, error) { | |||
collaborators := make([]*User, 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
collaborators := make([]*User, 0, 10)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -10,6 +10,29 @@ import ( | |||
"fmt" | |||
) | |||
|
|||
// ListCollaborators list a repository's collaborators | |||
func (c *Client) ListCollaborators(user, repo string) ([]*User, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's OKay.
57d9fef
to
54a391b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
Add functions corresponding to the following endpoints:
GET repos/:username/:reponame/collaborators
: list collaboratorsGET repos/:username/:reponame/collaborators/:collaborator
: check if a user is a collaboratorDELETE repos/:username/:reponame/collaborators/:collaborator
: remove a collaboratorThese endpoints are implemented in go-gitea/gitea#375.