golf

:golf: The Golf web framework

Github星跟蹤圖

GoDoc
License
Build Status
Build Status
Coverage Status

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

Installation

go get github.com/dinever/golf

Features

  1. No allocation during routing and parameter retrieve.

  2. Dead simple template inheritance with extends and include 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>
    
  3. Built-in XSRF and Session support.

  4. Powerful middleware chain.

  5. Configuration from JSON file.

Hello World

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")
}

The website will be available at http://localhost:9000.

Benchmark

The following chart shows the benchmark performance of Golf compared with others.

Golf benchmark

For more information, please see BENCHMARKING.md

Docs

golf.readme.io/docs

License

MIT License

主要指標

概覽
名稱與所有者dinever/golf
主編程語言Go
編程語言Go (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2015-11-18 15:10:14
推送於2021-08-27 22:20:34
最后一次提交2017-02-24 11:57:24
發布數4
最新版本名稱v0.3.0 (發布於 )
第一版名稱v0.1.0 (發布於 )
用户参与
星數269
關注者數17
派生數29
提交數194
已啟用問題?
問題數19
打開的問題數6
拉請求數12
打開的拉請求數0
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?