feat: add gitlab source for gitlab package registry

cleanup http source
This commit is contained in:
Technofab 2023-09-25 14:40:39 +02:00
parent 8ffad5a3ea
commit d655269156
No known key found for this signature in database
GPG key ID: A0AA746B951C8830
7 changed files with 180 additions and 70 deletions

View file

@ -302,10 +302,12 @@ func download(d deps.Dependency, vendorDir, pathToParentModule string) (*deps.De
p = NewLocalPackage(&deps.Local{Directory: modulePath})
case d.Source.HttpSource != nil:
p = NewHttpPackage(d.Source.HttpSource)
case d.Source.GitlabRegistrySource != nil:
p = NewGitlabRegistryPackage(d.Source.GitlabRegistrySource)
}
if p == nil {
return nil, errors.New("either git, local or http source is required")
return nil, errors.New("either git, local, http or gitlab source is required")
}
version, err := p.Install(context.TODO(), d.Name(), vendorDir, d.Version)