mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 10:27:06 +00:00
Update to 8.4.0 | New macro type, new high-optimized MVC features. Read HISTORY.md
Former-commit-id: b72a23ba063be60a9750c8b1b0df024b0c8ed549
This commit is contained in:
35
mvc/activator/methodfunc/methodfunc.go
Normal file
35
mvc/activator/methodfunc/methodfunc.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package methodfunc
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
)
|
||||
|
||||
// MethodFunc the handler function.
|
||||
type MethodFunc struct {
|
||||
FuncInfo
|
||||
FuncCaller
|
||||
RelPath string
|
||||
}
|
||||
|
||||
// Resolve returns all the method funcs
|
||||
// necessary information and actions to
|
||||
// perform the request.
|
||||
func Resolve(typ reflect.Type) (methodFuncs []MethodFunc) {
|
||||
infos := fetchInfos(typ)
|
||||
for _, info := range infos {
|
||||
p, ok := resolveRelativePath(info)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
caller := resolveCaller(p)
|
||||
methodFunc := MethodFunc{
|
||||
RelPath: p.RelPath,
|
||||
FuncInfo: info,
|
||||
FuncCaller: caller,
|
||||
}
|
||||
|
||||
methodFuncs = append(methodFuncs, methodFunc)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user