MCPcopy Create free account
hub / github.com/ChappIO/git-backup / discoverRepos

Method discoverRepos

github.go:178–202  ·  view source on GitHub ↗
(page int)

Source from the content-addressed store, hash-verified

176}
177
178func (c *GithubConfig) discoverRepos(page int) ([]*github.Repository, *github.Response, error) {
179 affiliations := make([]string, 0)
180
181 if *c.Owned {
182 affiliations = append(affiliations, "owner")
183 }
184 if *c.Collaborator {
185 affiliations = append(affiliations, "collaborator")
186 }
187 if *c.OrgMember {
188 affiliations = append(affiliations, "organization_member")
189 }
190
191 if len(affiliations) == 0 {
192 return make([]*github.Repository, 0), &github.Response{}, nil
193 }
194
195 return c.client.Repositories.List(context.Background(), "", &github.RepositoryListOptions{
196 ListOptions: github.ListOptions{
197 Page: page,
198 PerPage: 100,
199 },
200 Affiliation: strings.Join(affiliations, ","),
201 })
202}
203
204func (c *GithubConfig) getStarredRepos(page int) ([]*github.Repository, *github.Response, error) {
205 starred, response, err := c.client.Activity.ListStarred(context.Background(), "", &github.ActivityListStarredOptions{

Callers 1

getAllReposMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected