1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-21 03:47:04 +00:00

Conversion once at macros and their functions, internal changes required

Former-commit-id: 7b778cccfb7c0e30ca5e8106017ada065993aba5
This commit is contained in:
Gerasimos (Makis) Maropoulos
2018-09-27 03:17:45 +03:00
parent dc3c38b189
commit d6d27b2605
11 changed files with 338 additions and 279 deletions

View File

@@ -6,15 +6,13 @@ import (
"runtime"
"github.com/kataras/iris/context"
"github.com/kataras/iris/core/memstore"
"github.com/kataras/iris/hero/di"
"github.com/kataras/golog"
)
var (
contextTyp = reflect.TypeOf((*context.Context)(nil)).Elem()
memstoreTyp = reflect.TypeOf(memstore.Store{})
contextTyp = reflect.TypeOf((*context.Context)(nil)).Elem()
)
// IsContext returns true if the "inTyp" is a type of Context.
@@ -22,14 +20,6 @@ func IsContext(inTyp reflect.Type) bool {
return inTyp.Implements(contextTyp)
}
// IsExpectingStore returns true if the "inTyp" is a type of memstore.Store.
func IsExpectingStore(inTyp reflect.Type) bool {
print("di/handler.go: " + inTyp.String() + " vs " + memstoreTyp.String() + " : ")
println(inTyp == memstoreTyp)
return inTyp == memstoreTyp
}
// checks if "handler" is context.Handler: func(context.Context).
func isContextHandler(handler interface{}) (context.Handler, bool) {
h, is := handler.(context.Handler)