-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
integration FastInvoke Handler #91
Conversation
verify handlers
Update router.go
This commit calls `filepath.EvalSymlinks` before `filepath.Walk` in the initialization of the template file system in order to allow it to be a symlink. Otherwise `filepath.Walk` would just yield the symlink itself, resulting in undefined templates. This does not allow to use symlinks **inside** the template directory. The error handling changes may look odd at first sight but it behaves as before; previously if `opt.Directory` was not an existing file, `filepath.Walk` would call the callback with the same unexisting directory as `path` plus an error (the error being ignored). `filepath.Rel` would not error on this, and the rest of the function would just do nothing provided that the unexisting directory does not have a known extension. Now in case of an error with `filepath.EvalSymlinks`, the rest of the function is just skipped (and as a side effect preventing potential errors when the unexisting directory have a known extension).
…directory-symlink allow symlink as template directory
So other middlewares can use type assertion to check if use has registered real render middleware.
This option allows render to have additional directories to overwrite templates that are previous defined. Also give application ability to have feature like custom templates.
User now allow to set hard limit of cookie.
Print date and time in log for requests.
@@ -72,6 +72,15 @@ func (r *Request) Body() *RequestBody { | |||
return &RequestBody{r.Request.Body} | |||
} | |||
|
|||
// ContextHandler Context Handler | |||
type ContextHandler func(ctx *Context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
也许改叫 ContextInvoker
更贴切点?其他地方也是。。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
被 wrap
后这个东西既是 Handler
也是 Invoker
, 或者叫 InvokerHandler
.
我先改成 Invoker
后面你再看着改吧.
今天的提交把增加的一个 Router.HandlerWrapAction
方法加了点注释, 加了点测试用例. 有了这个方法就不用每个 Handler
显式调用每个 Invoker
包装转换了, 只要 Router
注册的时候写一个统一的 类型断言
包装就行了 .
add Router.HandlerWrapAction test case
7d0fb8f
to
826ddf1
Compare
# Conflicts: # .gitignore # README.md # context.go # context_test.go # logger.go # macaron.go # render.go # render_test.go # return_handler_test.go # router.go # router_test.go # tree_test.go
整合
FastInvoke Handler
优化, 对Context/Logger/Recovery/render
几个中间件
做了适配.关联 inject #1 PR .
本次
PR
对inject/macaron/sockets
几个项目都做了修改和整合.