mirror of
https://github.com/kataras/iris.git
synced 2025-12-22 20:37:05 +00:00
update to version 8.4.1 ❤️ https://github.com/kataras/iris/blob/master/HISTORY.md#th-07-september-2017--v841
Former-commit-id: 9e5f0a08049b83605aa847b8f51fb856427354a6
This commit is contained in:
@@ -18,13 +18,18 @@ const (
|
||||
// Declaration: /mypath/{myparam:string} or /mypath{myparam}
|
||||
ParamTypeString
|
||||
// ParamTypeInt is the integer, a number type.
|
||||
// Allows only numbers (0-9)
|
||||
// Allows only possitive numbers (0-9)
|
||||
// Declaration: /mypath/{myparam:int}
|
||||
ParamTypeInt
|
||||
// ParamTypeLong is the integer, a number type.
|
||||
// Allows only numbers (0-9)
|
||||
// Allows only possitive numbers (0-9)
|
||||
// Declaration: /mypath/{myparam:long}
|
||||
ParamTypeLong
|
||||
// ParamTypeBoolean is the bool type.
|
||||
// Allows only "1" or "t" or "T" or "TRUE" or "true" or "True"
|
||||
// or "0" or "f" or "F" or "FALSE" or "false" or "False".
|
||||
// Declaration: /mypath/{myparam:boolean}
|
||||
ParamTypeBoolean
|
||||
// ParamTypeAlphabetical is the alphabetical/letter type type.
|
||||
// Allows letters only (upper or lowercase)
|
||||
// Declaration: /mypath/{myparam:alphabetical}
|
||||
@@ -49,6 +54,7 @@ var paramTypes = map[string]ParamType{
|
||||
"string": ParamTypeString,
|
||||
"int": ParamTypeInt,
|
||||
"long": ParamTypeLong,
|
||||
"boolean": ParamTypeBoolean,
|
||||
"alphabetical": ParamTypeAlphabetical,
|
||||
"file": ParamTypeFile,
|
||||
"path": ParamTypePath,
|
||||
|
||||
@@ -131,6 +131,13 @@ func TestParseParam(t *testing.T) {
|
||||
Type: ast.ParamTypeLong,
|
||||
ErrorCode: 404,
|
||||
}}, // 8
|
||||
{true,
|
||||
ast.ParamStatement{
|
||||
Src: "{has:boolean else 404}",
|
||||
Name: "has",
|
||||
Type: ast.ParamTypeBoolean,
|
||||
ErrorCode: 404,
|
||||
}}, // 9
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user