summaryrefslogtreecommitdiffstats
path: root/models/packages
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2023-03-13 21:28:39 +0100
committerGitHub <noreply@github.com>2023-03-13 15:28:39 -0500
commitc709fa17a77eae391cafbe72d6b2594f74d86a60 (patch)
tree9c6ab67126c7d59a6db274ec5a9f75cdfe120be6 /models/packages
parent0a6f6354bbc03d4a3ad382a432113301e9ea9d86 (diff)
downloadgitea-c709fa17a77eae391cafbe72d6b2594f74d86a60.tar.gz
gitea-c709fa17a77eae391cafbe72d6b2594f74d86a60.zip
Add Swift package registry (#22404)
This PR adds a [Swift](https://www.swift.org/) package registry. ![grafik](https://user-images.githubusercontent.com/1666336/211842523-07521cbd-8fb6-400f-820c-ee8048b05ae8.png)
Diffstat (limited to 'models/packages')
-rw-r--r--models/packages/descriptor.go3
-rw-r--r--models/packages/package.go6
2 files changed, 9 insertions, 0 deletions
diff --git a/models/packages/descriptor.go b/models/packages/descriptor.go
index f4be21e74e..06699b5d57 100644
--- a/models/packages/descriptor.go
+++ b/models/packages/descriptor.go
@@ -24,6 +24,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/swift"
"code.gitea.io/gitea/modules/packages/vagrant"
"github.com/hashicorp/go-version"
@@ -159,6 +160,8 @@ func GetPackageDescriptor(ctx context.Context, pv *PackageVersion) (*PackageDesc
metadata = &pypi.Metadata{}
case TypeRubyGems:
metadata = &rubygems.Metadata{}
+ case TypeSwift:
+ metadata = &swift.Metadata{}
case TypeVagrant:
metadata = &vagrant.Metadata{}
default:
diff --git a/models/packages/package.go b/models/packages/package.go
index 32f30fab9b..ccc9257c31 100644
--- a/models/packages/package.go
+++ b/models/packages/package.go
@@ -44,6 +44,7 @@ const (
TypePub Type = "pub"
TypePyPI Type = "pypi"
TypeRubyGems Type = "rubygems"
+ TypeSwift Type = "swift"
TypeVagrant Type = "vagrant"
)
@@ -62,6 +63,7 @@ var TypeList = []Type{
TypePub,
TypePyPI,
TypeRubyGems,
+ TypeSwift,
TypeVagrant,
}
@@ -96,6 +98,8 @@ func (pt Type) Name() string {
return "PyPI"
case TypeRubyGems:
return "RubyGems"
+ case TypeSwift:
+ return "Swift"
case TypeVagrant:
return "Vagrant"
}
@@ -133,6 +137,8 @@ func (pt Type) SVGName() string {
return "gitea-python"
case TypeRubyGems:
return "gitea-rubygems"
+ case TypeSwift:
+ return "gitea-swift"
case TypeVagrant:
return "gitea-vagrant"
}