summaryrefslogtreecommitdiffstats
path: root/models/packages
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-08-07 12:09:54 +0200
committerGitHub <noreply@github.com>2022-08-07 18:09:54 +0800
commitf55af4675cbcb0170693caaeb5faa7707836de4c (patch)
tree8942f12d712396bd8c3fd381c5e33a8bab52edc8 /models/packages
parentd4326afb25ae84131d6b9fd61d6f869828f7704b (diff)
downloadgitea-f55af4675cbcb0170693caaeb5faa7707836de4c.tar.gz
gitea-f55af4675cbcb0170693caaeb5faa7707836de4c.zip
Add support for Pub packages (#20560)
* Added support for Pub packages. * Update docs/content/doc/packages/overview.en-us.md Co-authored-by: Gergely Nagy <algernon@users.noreply.github.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Gergely Nagy <algernon@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'models/packages')
-rw-r--r--models/packages/descriptor.go3
-rw-r--r--models/packages/package.go5
2 files changed, 8 insertions, 0 deletions
diff --git a/models/packages/descriptor.go b/models/packages/descriptor.go
index 31819ccca1..dc753421d0 100644
--- a/models/packages/descriptor.go
+++ b/models/packages/descriptor.go
@@ -19,6 +19,7 @@ import (
"code.gitea.io/gitea/modules/packages/maven"
"code.gitea.io/gitea/modules/packages/npm"
"code.gitea.io/gitea/modules/packages/nuget"
+ "code.gitea.io/gitea/modules/packages/pub"
"code.gitea.io/gitea/modules/packages/pypi"
"code.gitea.io/gitea/modules/packages/rubygems"
@@ -143,6 +144,8 @@ func GetPackageDescriptor(ctx context.Context, pv *PackageVersion) (*PackageDesc
metadata = &npm.Metadata{}
case TypeMaven:
metadata = &maven.Metadata{}
+ case TypePub:
+ metadata = &pub.Metadata{}
case TypePyPI:
metadata = &pypi.Metadata{}
case TypeRubyGems:
diff --git a/models/packages/package.go b/models/packages/package.go
index 97cfbc6cad..39b1c83cfa 100644
--- a/models/packages/package.go
+++ b/models/packages/package.go
@@ -39,6 +39,7 @@ const (
TypeMaven Type = "maven"
TypeNpm Type = "npm"
TypeNuGet Type = "nuget"
+ TypePub Type = "pub"
TypePyPI Type = "pypi"
TypeRubyGems Type = "rubygems"
)
@@ -62,6 +63,8 @@ func (pt Type) Name() string {
return "npm"
case TypeNuGet:
return "NuGet"
+ case TypePub:
+ return "Pub"
case TypePyPI:
return "PyPI"
case TypeRubyGems:
@@ -89,6 +92,8 @@ func (pt Type) SVGName() string {
return "gitea-npm"
case TypeNuGet:
return "gitea-nuget"
+ case TypePub:
+ return "gitea-pub"
case TypePyPI:
return "gitea-python"
case TypeRubyGems: