mirror of
https://github.com/kataras/iris.git
synced 2026-05-14 18:13:49 +00:00
add tests for the new types (int8, int16, int32, uint, uint8, uint16, uint32, uint64)
Former-commit-id: 812b3fdcc47abdeac271473bfdbdd15f0afd0bc0
This commit is contained in:
14
README.md
14
README.md
@@ -114,9 +114,15 @@ func main() {
|
||||
| Param Type | Go Type | Validation | Retrieve Helper |
|
||||
| -----------------|------|-------------|------|
|
||||
| `:string` | string | anything | `Params().Get` |
|
||||
| `:int` | uint, uint8, uint16, uint32, uint64, int, int8, int32, int64 | positive or negative number, depends on the arch | `Params().GetInt`...|
|
||||
| `:int` | int | -9223372036854775808 to 9223372036854775807 (x64) or -2147483648 to 2147483647 (x32), depends on the host arch | `Params().GetInt` |
|
||||
| `:int8` | int8 | -128 to 127 | `Params().GetInt8` |
|
||||
| `:int16` | int16 | -32768 to 32767 | `Params().GetInt16` |
|
||||
| `:int32` | int32 | -2147483648 to 2147483647 | `Params().GetInt32` |
|
||||
| `:int64` | int64 | -9223372036854775808 to 9223372036854775807 | `Params().GetInt64` |
|
||||
| `:uint` | uint | 0 to 18446744073709551615 (x64) or 0 to 4294967295 (x32), depends on the host arch | `Params().GetUint` |
|
||||
| `:uint8` | uint8 | 0 to 255 | `Params().GetUint8` |
|
||||
| `:uint16` | uint16 | 0 to 65535 | `Params().GetUint16` |
|
||||
| `:uint32` | uint32 | 0 to 4294967295 | `Params().GetUint32` |
|
||||
| `:uint64` | uint64 | 0 to 18446744073709551615 | `Params().GetUint64` |
|
||||
| `:bool` | bool | "1" or "t" or "T" or "TRUE" or "true" or "True" or "0" or "f" or "F" or "FALSE" or "false" or "False" | `Params().GetBool` |
|
||||
| `:alphabetical` | string | lowercase or uppercase letters | `Params().Get` |
|
||||
@@ -138,9 +144,9 @@ app.Get("/users/{id:uint64}", func(ctx iris.Context){
|
||||
| `prefix`(prefix string) | :string |
|
||||
| `suffix`(suffix string) | :string |
|
||||
| `contains`(s string) | :string |
|
||||
| `min`(minValue int or int8 or int16 or int32 or int64 or uint8 or uint16 or uint32 or uint64 or float32 or float64) | :string(char length), :number, :int64, :uint8, :uint64 |
|
||||
| `max`(maxValue int or int8 or int16 or int32 or int64 or uint8 or uint16 or uint32 or uint64 or float32 or float64) | :string(char length), :number, :int64, :uint8, :uint64 |
|
||||
| `range`(minValue, maxValue int or int8 or int16 or int32 or int64 or uint8 or uint16 or uint32 or uint64 or float32 or float64) | :number, :int64, :uint8, :uint64 |
|
||||
| `min`(minValue int or int8 or int16 or int32 or int64 or uint8 or uint16 or uint32 or uint64 or float32 or float64) | :string(char length), :int, :int8, :int16, :int32, :int64, :uint, :uint8, :uint16, :uint32, :uint64 |
|
||||
| `max`(maxValue int or int8 or int16 or int32 or int64 or uint8 or uint16 or uint32 or uint64 or float32 or float64) | :string(char length), :int, :int8, :int16, :int32, :int64, :uint, :uint8, :uint16, :uint32, :uint64 |
|
||||
| `range`(minValue, maxValue int or int8 or int16 or int32 or int64 or uint8 or uint16 or uint32 or uint64 or float32 or float64) | :int, :int8, :int16, :int32, :int64, :uint, :uint8, :uint16, :uint32, :uint64 |
|
||||
|
||||
**Usage**:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user