mirror of
https://github.com/kataras/iris.git
synced 2026-01-23 20:05:59 +00:00
performance close to handlers if no bindings but even if bindings except service (new feature is that we can bind functions as well) is x1.1 faster than the previous mvc implementation - make BaseController (so and C) optionally but not break the existing APIs that using iris.C or mvc.C
Former-commit-id: a26a8f836894c061e0f435df8ac1c2c534f0ee48
This commit is contained in:
@@ -8,10 +8,16 @@ import (
|
||||
"github.com/kataras/pkg/zerocheck"
|
||||
)
|
||||
|
||||
var contextTyp = reflect.TypeOf(context.NewContext(nil))
|
||||
var baseControllerTyp = reflect.TypeOf((*BaseController)(nil)).Elem()
|
||||
|
||||
func isBaseController(ctrlTyp reflect.Type) bool {
|
||||
return ctrlTyp.Implements(baseControllerTyp)
|
||||
}
|
||||
|
||||
var contextTyp = reflect.TypeOf((*context.Context)(nil)).Elem()
|
||||
|
||||
func isContext(inTyp reflect.Type) bool {
|
||||
return inTyp.String() == "context.Context" // I couldn't find another way; context/context.go is not exported.
|
||||
return inTyp.Implements(contextTyp)
|
||||
}
|
||||
|
||||
func indirectVal(v reflect.Value) reflect.Value {
|
||||
|
||||
Reference in New Issue
Block a user