1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-19 10:57:05 +00:00

add TLSConfig on redis configuration #1515

Former-commit-id: 3ce4a43185c7b6b5250f49483d7d229ea9dd1670
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-05-17 03:25:32 +03:00
parent 571322f595
commit 21a013569f
6 changed files with 78 additions and 62 deletions

View File

@@ -97,6 +97,14 @@ func (api *APIContainer) convertHandlerFuncs(relativePath string, handlersFn ...
return handlers
}
func fixRouteInfo(route *Route, handlersFn []interface{}) {
// Fix main handler name and source modified by execution rules wrapper.
route.MainHandlerName, route.MainHandlerIndex = context.MainHandlerName(handlersFn...)
if len(handlersFn) > route.MainHandlerIndex {
route.SourceFileName, route.SourceLineNumber = context.HandlerFileLineRel(handlersFn[route.MainHandlerIndex])
}
}
// Handler receives a function which can receive dependencies and output result
// and returns a common Iris Handler, useful for Versioning API integration otherwise
// the `Handle/Get/Post...` methods are preferable.
@@ -134,13 +142,7 @@ func (api *APIContainer) Done(handlersFn ...interface{}) {
func (api *APIContainer) Handle(method, relativePath string, handlersFn ...interface{}) *Route {
handlers := api.convertHandlerFuncs(relativePath, handlersFn...)
route := api.Self.Handle(method, relativePath, handlers...)
// Fix main handler name and source modified by execution rules wrapper.
route.MainHandlerName, route.MainHandlerIndex = context.MainHandlerName(handlersFn...)
if len(handlersFn) > route.MainHandlerIndex {
route.SourceFileName, route.SourceLineNumber = context.HandlerFileLineRel(handlersFn[route.MainHandlerIndex])
}
fixRouteInfo(route, handlersFn)
return route
}