1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-31 16:57:04 +00:00

Update to 8.4.0 | New macro type, new high-optimized MVC features. Read HISTORY.md

Former-commit-id: b72a23ba063be60a9750c8b1b0df024b0c8ed549
This commit is contained in:
kataras
2017-08-27 18:46:04 +03:00
parent 8602517371
commit 591806795e
37 changed files with 1242 additions and 453 deletions

View File

@@ -21,6 +21,10 @@ const (
// Allows only numbers (0-9)
// Declaration: /mypath/{myparam:int}
ParamTypeInt
// ParamTypeLong is the integer, a number type.
// Allows only numbers (0-9)
// Declaration: /mypath/{myparam:long}
ParamTypeLong
// ParamTypeAlphabetical is the alphabetical/letter type type.
// Allows letters only (upper or lowercase)
// Declaration: /mypath/{myparam:alphabetical}
@@ -44,6 +48,7 @@ const (
var paramTypes = map[string]ParamType{
"string": ParamTypeString,
"int": ParamTypeInt,
"long": ParamTypeLong,
"alphabetical": ParamTypeAlphabetical,
"file": ParamTypeFile,
"path": ParamTypePath,

View File

@@ -60,6 +60,7 @@ func TestParseParam(t *testing.T) {
},
ErrorCode: 404,
}}, // 0
{true,
ast.ParamStatement{
Src: "{id:int range(1,5)}",
@@ -123,6 +124,13 @@ func TestParseParam(t *testing.T) {
},
ErrorCode: 404,
}}, // 7
{true,
ast.ParamStatement{
Src: "{id:long else 404}",
Name: "id",
Type: ast.ParamTypeLong,
ErrorCode: 404,
}}, // 8
}