Documentation ¶
Index ¶
- func ClearHandlerToRoute() map[string]*HandleFunc
- func LastHandler()
- func MatchPrefixAndDelHandler(prefix string) map[string]*HandleFunc
- func ParseFunc(structFuncName string, f func(*context.Context))
- func ParseStruct(strut ControllerInstance, aliasName string)
- func ParseStructToRoute(strut ControllerInstance, aliasName string) map[string]*HandleFunc
- func ParseStructsToRoute(strut ...ControllerInstance) map[string]*HandleFunc
- type Control
- type ControllerInstance
- type HandleFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearHandlerToRoute ¶
func ClearHandlerToRoute() map[string]*HandleFunc
ClearHandlerToRoute 返回剩余未处理的handler
func MatchPrefixAndDelHandler ¶
func MatchPrefixAndDelHandler(prefix string) map[string]*HandleFunc
MatchPrefixAndDelHandler 根据前缀匹配返回handler
func ParseStruct ¶
func ParseStruct(strut ControllerInstance, aliasName string)
ParseStruct 解析struct 生成方法与路由的映射关系 structName首字母转小写 如果aliasName不为空,则以aliasName为准 funcName也会首字母转小写
func ParseStructToRoute ¶
func ParseStructToRoute(strut ControllerInstance, aliasName string) map[string]*HandleFunc
func ParseStructsToRoute ¶
func ParseStructsToRoute(strut ...ControllerInstance) map[string]*HandleFunc
Types ¶
type ControllerInstance ¶
type ControllerInstance func() Control
type HandleFunc ¶
type HandleFunc struct { StructFuncName string //原始struct名称和方法名称 如果为函数则名称为初始匹配名称 // contains filtered or unexported fields }
HandleFunc 处理方法
func MatchAndDelHandler ¶
func MatchAndDelHandler(pattern string) *HandleFunc
MatchAndDelHandler key完全匹配返回handler并将其从库中删除
func ParseFuncToRoute ¶
func ParseFuncToRoute(structFuncName string, f func(*context.Context)) *HandleFunc
Click to show internal directories.
Click to hide internal directories.