Skip to content
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

Merged
merged 182 commits into from
Jan 28, 2017
Merged

integration FastInvoke Handler #91

merged 182 commits into from
Jan 28, 2017

Conversation

tupunco
Copy link
Contributor

@tupunco tupunco commented Jun 4, 2016

整合 FastInvoke Handler 优化, 对 Context/Logger/Recovery/render 几个 中间件 做了适配.

关联 inject #1 PR .

本次 PRinject/macaron/sockets 几个项目都做了修改和整合.

unknwon and others added 23 commits October 10, 2015 22:44
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)
Copy link
Contributor

@unknwon unknwon Jul 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

也许改叫 ContextInvoker 更贴切点?其他地方也是。。

Copy link
Contributor Author

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
@unknwon unknwon force-pushed the master branch 2 times, most recently from 7d0fb8f to 826ddf1 Compare September 16, 2016 01:07
# 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
@unknwon unknwon merged commit 0423e85 into go-macaron:master Jan 28, 2017
unknwon added a commit that referenced this pull request Jan 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

9 participants