- Notifications
You must be signed in to change notification settings - Fork29
dinever/golf
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A fast, simple and lightweight micro-web framework for Go, comes with powerful features and has no dependencies other than the Go Standard Library.
Homepage:golf.readme.io
go get github.com/dinever/golf
No allocation during routing and parameter retrieve.
Dead simple template inheritance with
extends
andinclude
helper comes out of box.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>
Built-in XSRF and Session support.
Powerful middleware chain.
Configuration from JSON file.
package mainimport"github.com/dinever/golf"funcmainHandler(ctx*golf.Context) {ctx.Send("Hello World!")}funcpageHandler(ctx*golf.Context) {ctx.Send("Page: "+ctx.Param("page"))}funcmain() {app:=golf.New()app.Get("/",mainHandler)app.Get("/p/:page/",pageHandler)app.Run(":9000")}
The website will be available athttp://localhost:9000.
The following chart shows the benchmark performance of Golf compared with others.
For more information, please seeBENCHMARKING.md
About
⛳ The Golf web framework
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published