Documentation ¶
Index ¶
- func InitRouterSegment()
- type RouteParse
- func (r *RouteParse) BindFunc(structFuncName string, f func(*context.Context)) *RouteParse
- func (r *RouteParse) BindMiddleware(m ...middleware.Middleware) *RouteParse
- func (r *RouteParse) BindStruct(strut handleFuncParse.ControllerInstance, aliasName string) *RouteParse
- func (r *RouteParse) BindStructs(struts ...handleFuncParse.ControllerInstance) *RouteParse
- func (r *RouteParse) MatchFunc(newPath, structFuncName string) *RouteParse
- func (r *RouteParse) MatchPrefixToFunc(structFuncName string) *RouteParse
- func (r *RouteParse) Prefix(str string) *RouteParse
- type Router
- type Segment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RouteParse ¶
type RouteParse struct { Middleware []middleware.Middleware //中间件 多个 可多次添加 当有一次使用后 清空 // contains filtered or unexported fields }
RouteParse 路由解析器
func (*RouteParse) BindFunc ¶
func (r *RouteParse) BindFunc(structFuncName string, f func(*context.Context)) *RouteParse
BindFunc 绑定函数
func (*RouteParse) BindMiddleware ¶
func (r *RouteParse) BindMiddleware(m ...middleware.Middleware) *RouteParse
BindMiddleware 绑定中间件
func (*RouteParse) BindStruct ¶
func (r *RouteParse) BindStruct(strut handleFuncParse.ControllerInstance, aliasName string) *RouteParse
BindStruct 绑定当个struct 可为struct设置别名
func (*RouteParse) BindStructs ¶
func (r *RouteParse) BindStructs(struts ...handleFuncParse.ControllerInstance) *RouteParse
BindStructs 绑定多个struct
func (*RouteParse) MatchFunc ¶
func (r *RouteParse) MatchFunc(newPath, structFuncName string) *RouteParse
MatchFunc 匹配hangdleFuncParse下面已解析完的方法
func (*RouteParse) MatchPrefixToFunc ¶
func (r *RouteParse) MatchPrefixToFunc(structFuncName string) *RouteParse
MatchPrefixToFunc 将包含前缀的路由 全部解析到指定的方法
type Router ¶
type Router struct { Handler *handleFuncParse.HandleFunc Middleware []middleware.Middleware }
Router 外部通过Router初始化路由规则
Click to show internal directories.
Click to hide internal directories.