Gitea remote support
This commit is contained in:
@@ -3,6 +3,7 @@ package gitearemote
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/load"
|
||||
@@ -15,11 +16,11 @@ func (r *GiteaRemote) GetNumProjects(opts *remote.RemoteQueryOpts) int {
|
||||
var projects int
|
||||
_, resp, err := r.api.SearchRepos(gitea.SearchRepoOptions{ListOptions: gitea.ListOptions{PageSize: 1}})
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return -1
|
||||
}
|
||||
|
||||
fmt.Println(resp)
|
||||
|
||||
projects, _ = strconv.Atoi(resp.Header.Get("X-Total-Count"))
|
||||
return projects
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user