Skip to content

Commit

Permalink
Merge pull request #331 from LinuxSuRen/improve-doc
Browse files Browse the repository at this point in the history
Improve the comments of the github/repo.go
  • Loading branch information
jenkins-x-bot authored Jun 16, 2022
2 parents cb31064 + dc97200 commit 3e58d4f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scm/driver/github/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ func (s *repositoryService) FindPerms(ctx context.Context, repo string) (*scm.Pe
return convertRepository(out).Perm, res, err
}

// FindPerms returns the repository permissions.
//
// FindUserPermission returns the repository permissions.
// https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level
func (s *repositoryService) FindUserPermission(ctx context.Context, repo, user string) (string, *scm.Response, error) {
path := fmt.Sprintf("repos/%s/collaborators/%s/permission", repo, user)
Expand All @@ -193,7 +192,7 @@ func (s *repositoryService) List(ctx context.Context, opts scm.ListOptions) ([]*
Method: http.MethodGet,
Path: fmt.Sprintf("user/repos?visibility=all&affiliation=owner&%s", encodeListOptions(opts)),
Header: map[string][]string{
// This accept header enables the visibility parameter.
// This accepts header enables the visibility parameter.
// https://developer.github.com/changes/2019-12-03-internal-visibility-changes/
"Accept": {"application/vnd.github.nebula-preview+json"},
},
Expand All @@ -203,15 +202,15 @@ func (s *repositoryService) List(ctx context.Context, opts scm.ListOptions) ([]*
return convertRepositoryList(out), res, err
}

// List returns the repositories for an organisation
// ListOrganisation returns the repositories for an organisation
func (s *repositoryService) ListOrganisation(ctx context.Context, org string, opts scm.ListOptions) ([]*scm.Repository, *scm.Response, error) {
path := fmt.Sprintf("orgs/%s/repos?%s", org, encodeListOptions(opts))
out := []*repository{}
res, err := s.client.do(ctx, "GET", path, nil, &out)
return convertRepositoryList(out), res, err
}

// List returns the repositories for a user
// ListUser returns the public repositories for the specified user
func (s *repositoryService) ListUser(ctx context.Context, user string, opts scm.ListOptions) ([]*scm.Repository, *scm.Response, error) {
path := fmt.Sprintf("users/%s/repos?%s", user, encodeListOptions(opts))
out := []*repository{}
Expand Down

0 comments on commit 3e58d4f

Please sign in to comment.