mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-29 06:00:03 +02:00
Add Cargo package registry (#21888)
This PR implements a [Cargo registry](https://doc.rust-lang.org/cargo/) to manage Rust packages. This package type was a little bit more complicated because Cargo needs an additional Git repository to store its package index. Screenshots:    --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
7baeb9c52a
commit
df789d962b
35 changed files with 1660 additions and 125 deletions
|
@ -30,6 +30,7 @@ type Type string
|
|||
|
||||
// List of supported packages
|
||||
const (
|
||||
TypeCargo Type = "cargo"
|
||||
TypeComposer Type = "composer"
|
||||
TypeConan Type = "conan"
|
||||
TypeConda Type = "conda"
|
||||
|
@ -46,6 +47,7 @@ const (
|
|||
)
|
||||
|
||||
var TypeList = []Type{
|
||||
TypeCargo,
|
||||
TypeComposer,
|
||||
TypeConan,
|
||||
TypeConda,
|
||||
|
@ -64,6 +66,8 @@ var TypeList = []Type{
|
|||
// Name gets the name of the package type
|
||||
func (pt Type) Name() string {
|
||||
switch pt {
|
||||
case TypeCargo:
|
||||
return "Cargo"
|
||||
case TypeComposer:
|
||||
return "Composer"
|
||||
case TypeConan:
|
||||
|
@ -97,6 +101,8 @@ func (pt Type) Name() string {
|
|||
// SVGName gets the name of the package type svg image
|
||||
func (pt Type) SVGName() string {
|
||||
switch pt {
|
||||
case TypeCargo:
|
||||
return "gitea-cargo"
|
||||
case TypeComposer:
|
||||
return "gitea-composer"
|
||||
case TypeConan:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue