diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-08-29 09:04:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-29 15:04:45 +0800 |
commit | 41c76ad71404bc0b4da83df063e6e10cd4a41e9f (patch) | |
tree | 0b281964d48b2f8b8e16368d9095fb1540b3e092 /models/packages | |
parent | 8a66b01e55d1988a814fed9f839f5e34c2e69d60 (diff) | |
download | gitea-41c76ad71404bc0b4da83df063e6e10cd4a41e9f.tar.gz gitea-41c76ad71404bc0b4da83df063e6e10cd4a41e9f.zip |
Add support for Vagrant packages (#20930)
* Add support for Vagrant boxes.
* Add authentication.
* Add tests.
* Add integration tests.
* Add docs.
* Add icons.
* Update routers/api/packages/api.go
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'models/packages')
-rw-r--r-- | models/packages/descriptor.go | 3 | ||||
-rw-r--r-- | models/packages/package.go | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/models/packages/descriptor.go b/models/packages/descriptor.go index dc753421d0..357574a706 100644 --- a/models/packages/descriptor.go +++ b/models/packages/descriptor.go @@ -22,6 +22,7 @@ import ( "code.gitea.io/gitea/modules/packages/pub" "code.gitea.io/gitea/modules/packages/pypi" "code.gitea.io/gitea/modules/packages/rubygems" + "code.gitea.io/gitea/modules/packages/vagrant" "github.com/hashicorp/go-version" ) @@ -150,6 +151,8 @@ func GetPackageDescriptor(ctx context.Context, pv *PackageVersion) (*PackageDesc metadata = &pypi.Metadata{} case TypeRubyGems: metadata = &rubygems.Metadata{} + case TypeVagrant: + metadata = &vagrant.Metadata{} default: panic(fmt.Sprintf("unknown package type: %s", string(p.Type))) } diff --git a/models/packages/package.go b/models/packages/package.go index 39b1c83cfa..c203901a2d 100644 --- a/models/packages/package.go +++ b/models/packages/package.go @@ -42,6 +42,7 @@ const ( TypePub Type = "pub" TypePyPI Type = "pypi" TypeRubyGems Type = "rubygems" + TypeVagrant Type = "vagrant" ) // Name gets the name of the package type @@ -69,6 +70,8 @@ func (pt Type) Name() string { return "PyPI" case TypeRubyGems: return "RubyGems" + case TypeVagrant: + return "Vagrant" } panic(fmt.Sprintf("unknown package type: %s", string(pt))) } @@ -98,6 +101,8 @@ func (pt Type) SVGName() string { return "gitea-python" case TypeRubyGems: return "gitea-rubygems" + case TypeVagrant: + return "gitea-vagrant" } panic(fmt.Sprintf("unknown package type: %s", string(pt))) } |