1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-29 15:57:09 +00:00
1. Fix index, including both start and end. So Literal[start:end+1] will
be a valid part.

2. Replace any with string, add file param type

3. Start of making the evaluator, starting with regexp for param types
(these expression can be changed or/and overriden by user later on)


Former-commit-id: ab95265f953dadbf84170b543e1ff8840f9c4a14
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-03-27 22:33:19 +03:00
parent 251eeb6bd0
commit 126c4de29b
8 changed files with 158 additions and 55 deletions

View File

@@ -4,25 +4,29 @@ type ParamType uint8
const (
ParamTypeUnExpected ParamType = iota
// /42
ParamTypeInt
// /myparam1
ParamTypeString
// /42
ParamTypeInt
// /myparam
ParamTypeAlphabetical
// /main.css
ParamTypeFile
// /myparam1/myparam2
ParamTypePath
)
var paramTypes = map[string]ParamType{
"int": ParamTypeInt,
"string": ParamTypeString,
"int": ParamTypeInt,
"alphabetical": ParamTypeAlphabetical,
"file": ParamTypeFile,
"path": ParamTypePath,
// could be named also:
// "tail":
// "wild"
// "wildcard"
}
func LookupParamType(ident string) ParamType {