1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 03:17:04 +00:00
This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-09-18 01:52:30 +03:00
parent 9e8a58bf3b
commit 3d99983d96
8 changed files with 111 additions and 49 deletions

View File

@@ -50,6 +50,31 @@ var (
return func(paramValue string) bool {
return max >= len(paramValue)
}
}).
// checks if param value's matches the given input
RegisterFunc("eq", func(s string) func(string) bool {
return func(paramValue string) bool {
return paramValue == s
}
}).
// checks if param value's matches at least one of the inputs
RegisterFunc("eqor", func(texts []string) func(string) bool {
if len(texts) == 1 {
text := texts[0]
return func(paramValue string) bool {
return paramValue == text
}
}
return func(paramValue string) bool {
for _, s := range texts {
if paramValue == s {
return true
}
}
return false
}
})
// Int or number type