summaryrefslogtreecommitdiff
path: root/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'http.go')
-rw-r--r--http.go22
1 files changed, 21 insertions, 1 deletions
diff --git a/http.go b/http.go
index 33f50bf..fb65080 100644
--- a/http.go
+++ b/http.go
@@ -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)
+}