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
麻省理工學院許可證