paginate
This commit is contained in:
parent
ebbcdeeb30
commit
f0e5bafff9
14
main.go
14
main.go
@ -61,8 +61,11 @@ func main() {
|
|||||||
}
|
}
|
||||||
fmt.Printf("Found \"%s\"\n", org.WebURL)
|
fmt.Printf("Found \"%s\"\n", org.WebURL)
|
||||||
|
|
||||||
repoList, _, err := client.Groups.ListGroupProjects(org.ID, &gitlab.ListGroupProjectsOptions{
|
var repoList []*gitlab.Project
|
||||||
ListOptions: gitlab.ListOptions{},
|
var page = 1
|
||||||
|
for {
|
||||||
|
repos, _, err := client.Groups.ListGroupProjects(org.ID, &gitlab.ListGroupProjectsOptions{
|
||||||
|
ListOptions: gitlab.ListOptions{PerPage: 10, Page: page},
|
||||||
Archived: optBool(false),
|
Archived: optBool(false),
|
||||||
IncludeSubgroups: optBool(false),
|
IncludeSubgroups: optBool(false),
|
||||||
})
|
})
|
||||||
@ -70,6 +73,13 @@ func main() {
|
|||||||
error(5, "Could not obtain repo list: %v\n", err)
|
error(5, "Could not obtain repo list: %v\n", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
repoList = append(repoList, repos...)
|
||||||
|
|
||||||
|
if len(repoList) < 10 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for i := range repoList {
|
for i := range repoList {
|
||||||
if !excludeRule.Match(repoList[i].Name) {
|
if !excludeRule.Match(repoList[i].Name) {
|
||||||
// for each NOT excluded repo ...
|
// for each NOT excluded repo ...
|
||||||
|
Loading…
Reference in New Issue
Block a user