diff options
Diffstat (limited to 'http.go')
| -rw-r--r-- | http.go | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -41,7 +41,7 @@ func (f *Forge) HttpPost(url string, data []byte) ([]byte, error) { return body, nil } -func (f *Forge) LookupPB(check *gitpb.Repos) (*gitpb.Repos, error) { +func (f *Forge) LookupPBorig(check *gitpb.Repos) (*gitpb.Repos, error) { url := forgeURL + "lookup" for repo := range check.IterByFullPath() { @@ -52,3 +52,23 @@ func (f *Forge) LookupPB(check *gitpb.Repos) (*gitpb.Repos, error) { return check.SubmitReposPB(url) } + +func (f *Forge) LookupPB(check *gitpb.Repos) (*gitpb.Repos, error) { + url := forgeURL + "lookup" + + queryPB := gitpb.NewRepos() + + for repo := range check.IterByFullPath() { + ns := repo.Namespace + if ns == "" { + ns = repo.GoInfo.GoPath + } + + newr := new(gitpb.Repo) + newr.Namespace = ns + + queryPB.AppendByNamespace(newr) + } + + return queryPB.SubmitReposPB(url) +} |
