Commit a8062fd5 authored by Ariën Holthuizen's avatar Ariën Holthuizen Committed by Sander van Harmelen

Add ListVisibleProjects to projects.go (#178)

parent e570ec95
......@@ -174,7 +174,7 @@ type ListProjectsOptions struct {
Statistics *bool `url:"statistics,omitempty" json:"statistics,omitempty"`
}
// ListProjects gets a list of projects accessible by the authenticated user.
// ListProjects gets a list of projects for which the authenticated user is a member
//
// GitLab API docs:
// https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#list-projects
......@@ -193,6 +193,25 @@ func (s *ProjectsService) ListProjects(opt *ListProjectsOptions, options ...Opti
return p, resp, err
}
// ListVisibleProjects gets a list of projects accessible by the authenticated user.
//
// GitLab API docs:
// https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/projects.md#list-projects
func (s *ProjectsService) ListVisibleProjects(opt *ListProjectsOptions, options ...OptionFunc) ([]*Project, *Response, error) {
req, err := s.client.NewRequest("GET", "projects/visible", opt, options)
if err != nil {
return nil, nil, err
}
var p []*Project
resp, err := s.client.Do(req, &p)
if err != nil {
return nil, resp, err
}
return p, resp, err
}
// ListOwnedProjects gets a list of projects which are owned by the
// authenticated user.
//
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment