1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-08 20:41:57 +00:00

add godoc comments for the updated macro package

Former-commit-id: 5a90777926f6457b6639514e51ce48a4a57886c6
This commit is contained in:
Gerasimos (Makis) Maropoulos
2018-10-16 01:39:27 +03:00
parent 3002736086
commit 8f53f7c399
6 changed files with 57 additions and 12 deletions

View File

@@ -90,6 +90,18 @@ func (r RequestParams) GetIntUnslashed(key string) (int, bool) {
}
var (
// ParamResolvers is the global param resolution for a parameter type for a specific go std or custom type.
//
// Key is the specific type, which should be unique.
// The value is a function which accepts the parameter index
// and it should return the value as the parameter type evaluator expects it.
// i.e [reflect.TypeOf("string")] = func(paramIndex int) interface{} {
// return func(ctx Context) <T> {
// return ctx.Params().GetEntryAt(paramIndex).ValueRaw.(<T>)
// }
// }
//
// Read https://github.com/kataras/iris/tree/master/_examples/routing/macros for more details.
ParamResolvers = map[reflect.Type]func(paramIndex int) interface{}{
reflect.TypeOf(""): func(paramIndex int) interface{} {
return func(ctx Context) string {