mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-23 19:47:07 +09:00
1 parent
297e619074
commit
8670decafb
7 files changed
+128
-2
No files matched your search
@@ -4,6 +4,10 @@
|
||||
|
||||
package models
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// UnitType is Unit's Type
|
||||
type UnitType int
|
||||
|
||||
@@ -137,3 +141,16 @@ var (
|
||||
UnitTypeExternalWiki: UnitExternalWiki,
|
||||
}
|
||||
)
|
||||
|
||||
// FindUnitTypes give the unit key name and return unit
|
||||
func FindUnitTypes(nameKeys ...string) (res []UnitType) {
|
||||
for _, key := range nameKeys {
|
||||
for t, u := range Units {
|
||||
if strings.EqualFold(key, u.NameKey) {
|
||||
res = append(res, t)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in new issue
Block a user