mirror of
https://github.com/kataras/iris.git
synced 2025-12-23 04:47:02 +00:00
add int8, int16, int32, uint, uint16 and uint32 default-builtn parameter types and macros - no doc update - no live tests yet - time for sleep
Former-commit-id: 4a27265a9f1368c4bbecd852691155e56c875673
This commit is contained in:
@@ -91,32 +91,59 @@ var (
|
||||
},
|
||||
reflect.Int: func(paramIndex int) interface{} {
|
||||
return func(ctx Context) int {
|
||||
v, _ := ctx.Params().GetEntryAt(paramIndex).IntDefault(0)
|
||||
return v
|
||||
// v, _ := ctx.Params().GetEntryAt(paramIndex).IntDefault(0)
|
||||
// return v
|
||||
return ctx.Params().GetEntryAt(paramIndex).ValueRaw.(int)
|
||||
}
|
||||
},
|
||||
reflect.Int8: func(paramIndex int) interface{} {
|
||||
return func(ctx Context) int8 {
|
||||
return ctx.Params().GetEntryAt(paramIndex).ValueRaw.(int8)
|
||||
}
|
||||
},
|
||||
reflect.Int16: func(paramIndex int) interface{} {
|
||||
return func(ctx Context) int16 {
|
||||
return ctx.Params().GetEntryAt(paramIndex).ValueRaw.(int16)
|
||||
}
|
||||
},
|
||||
reflect.Int32: func(paramIndex int) interface{} {
|
||||
return func(ctx Context) int32 {
|
||||
return ctx.Params().GetEntryAt(paramIndex).ValueRaw.(int32)
|
||||
}
|
||||
},
|
||||
reflect.Int64: func(paramIndex int) interface{} {
|
||||
return func(ctx Context) int64 {
|
||||
v, _ := ctx.Params().GetEntryAt(paramIndex).Int64Default(0)
|
||||
return v
|
||||
return ctx.Params().GetEntryAt(paramIndex).ValueRaw.(int64)
|
||||
}
|
||||
},
|
||||
reflect.Uint: func(paramIndex int) interface{} {
|
||||
return func(ctx Context) uint {
|
||||
return ctx.Params().GetEntryAt(paramIndex).ValueRaw.(uint)
|
||||
}
|
||||
},
|
||||
reflect.Uint8: func(paramIndex int) interface{} {
|
||||
return func(ctx Context) uint8 {
|
||||
v, _ := ctx.Params().GetEntryAt(paramIndex).Uint8Default(0)
|
||||
return v
|
||||
return ctx.Params().GetEntryAt(paramIndex).ValueRaw.(uint8)
|
||||
}
|
||||
},
|
||||
reflect.Uint16: func(paramIndex int) interface{} {
|
||||
return func(ctx Context) uint16 {
|
||||
return ctx.Params().GetEntryAt(paramIndex).ValueRaw.(uint16)
|
||||
}
|
||||
},
|
||||
reflect.Uint32: func(paramIndex int) interface{} {
|
||||
return func(ctx Context) uint32 {
|
||||
return ctx.Params().GetEntryAt(paramIndex).ValueRaw.(uint32)
|
||||
}
|
||||
},
|
||||
reflect.Uint64: func(paramIndex int) interface{} {
|
||||
return func(ctx Context) uint64 {
|
||||
v, _ := ctx.Params().GetEntryAt(paramIndex).Uint64Default(0)
|
||||
return v
|
||||
return ctx.Params().GetEntryAt(paramIndex).ValueRaw.(uint64)
|
||||
}
|
||||
},
|
||||
reflect.Bool: func(paramIndex int) interface{} {
|
||||
return func(ctx Context) bool {
|
||||
v, _ := ctx.Params().GetEntryAt(paramIndex).BoolDefault(false)
|
||||
return v
|
||||
return ctx.Params().GetEntryAt(paramIndex).ValueRaw.(bool)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user