golf
v0.3.0: Regular updates

快速,简单,轻巧的Micro-Web框架,具有强大的功能,除了GO标准库外没有其他依赖性。
主页:golf.readme.io
go get github.com/dinever/golf
路由和参数检索过程中没有分配。
带有extends的简单模板继承, include辅助辅助手册。
layout.html
< h1 > Hello World </ h1 >
{{ template "body" }}
{{ include "sidebar.html" }}index.html
{{ extends "layout.html" }}
{{ define "body"}}
< p >Main content</ p >
{{ end }}sidebar.html
< p >Sidebar content</ p >内置XSRF和会话支持。
强大的中间件链。
JSON文件的配置。
package main
import "github.com/dinever/golf"
func mainHandler ( ctx * golf. Context ) {
ctx . Send ( "Hello World!" )
}
func pageHandler ( ctx * golf. Context ) {
ctx . Send ( "Page: " + ctx . Param ( "page" ))
}
func main () {
app := golf . New ()
app . Get ( "/" , mainHandler )
app . Get ( "/p/:page/" , pageHandler )
app . Run ( ":9000" )
}该网站将通过http:// localhost:9000提供。
以下图表显示了与其他人相比,高尔夫的基准表现。
有关更多信息,请参阅Benchmarking.md
golf.readme.io/docs
麻省理工学院许可证