API support to list repos by org and user (#45)
This commit is contained in:
parent
c317bcf8d1
commit
7bea055c4a
1 changed files with 10 additions and 0 deletions
10
repo.go
10
repo.go
|
@ -47,6 +47,16 @@ func (c *Client) ListMyRepos() ([]*Repository, error) {
|
||||||
return repos, c.getParsedResponse("GET", "/user/repos", nil, nil, &repos)
|
return repos, c.getParsedResponse("GET", "/user/repos", nil, nil, &repos)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Client) ListUserRepos(user string) ([]*Repository, error) {
|
||||||
|
repos := make([]*Repository, 0, 10)
|
||||||
|
return repos, c.getParsedResponse("GET", fmt.Sprintf("/users/%s/repos", user), nil, nil, &repos)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Client) ListOrgRepos(org string) ([]*Repository, error) {
|
||||||
|
repos := make([]*Repository, 0, 10)
|
||||||
|
return repos, c.getParsedResponse("GET", fmt.Sprintf("/orgs/%s/repos", org), nil, nil, &repos)
|
||||||
|
}
|
||||||
|
|
||||||
type CreateRepoOption struct {
|
type CreateRepoOption struct {
|
||||||
Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(100)"`
|
Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(100)"`
|
||||||
Description string `json:"description" binding:"MaxSize(255)"`
|
Description string `json:"description" binding:"MaxSize(255)"`
|
||||||
|
|
Loading…
Reference in a new issue