百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

gramework

> 数据库
开源

快速可靠的 Golang Web 框架

390 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

快速可靠的 Golang Web 框架

Gramework

The Good Framework Gramework long-term testing stand metrics screenshot made with Gramework Stats Dashboard and metrics middleware

What is it?

Gramework is a fast, highly effective, reliable, SPA-first, go-way web framework made by a fasthttp maintainer. You get the simple yet powerful API, we handle optimizations internally. We're always glad to see your feature requests and PRs.


Reasons to use Gramework

  • Gramework has a stable API.
  • Gramework is battle-tested.
  • Gramework is made by a maintainer of fasthttp.
  • Gramework is one of the rare frameworks that can help you use your server's resources more efficiently.
  • Gramework lowers your infrastructure costs by using as little memory as possible.
  • Gramework helps you serve requests faster, and so it helps you increase conversions (source 1, source 2).
  • With Gramework you can build software faster using a simple yet powerful and highly optimized API.
  • With Gramework you get enterprise-grade support and answers to all your questions.
  • At the Gramework team, we respect our users.
  • You can directly contact the maintainer and donate for high priority feature.
  • You can be sure that all license questions are OK with gramework.

Go >= 1.10.8 is the oldest continously tested and supported version.

Useful links and info

If you encounter any vulnerabilities then please feel free to submit them via [email protected].

| Name | Link/Badge | |--- |--- | | Docs | GoDoc | | Our Jira | Jira | | License Report | Report | | Changelog | Changelog | | Support us with a donation or become a sponsor | OpenCollective | | Our Telegram chat | @gramework | | Our #gramework channel in the Gophers Slack | https://gophers.slack.com | | Our Discord Server | https://discord.gg/HkW8DsD | | Master branch coverage | | | Master branch status | | | Dev branch coverage | | | Dev branch status | | | CII Best Practices | | | Gramework Stats Dashboard for Grafana | https://grafana.com/dashboards/3422 | | Support contacts | Via email: [email protected] | | | Via Telegram community: @gramework |

Table of Contents

  • Benchmarks
  • 3rd-party license info
  • Basic usage
    • Hello world
    • Serving a dir
    • Serving prepared bytes
    • Using dynamic handlers, example 1
    • Using dynamic handlers, example 2

Benchmarks

Contributors

This project exists thanks to our awesome contributors! [Contribute].

Backers

Thank you to all our backers! [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

3rd-party license info

  • Gramework is now powered by fasthttp and an embedded custom fasthttprouter. You will find the according licenses in /third_party_licenses/fasthttp and /third_party_licenses/fasthttprouter.
  • The 3rd autoTLS implementation, placed in nettls_*.go, is an integrated version of caddytls, because using it through a simple import isn't an option, gramework is based on fasthttp, which is incompatible with net/http. In the commit I based on, caddy is Apache-2.0 licensed. Its license placed in /third_party_licenses/caddy. @mholt allow us to copy the code in this repo.

Basic usage

Hello world

The example below will serve "hello, grameworld". Gramework will register the bind flag for you, that allows you to choose another ip/port that gramework should listen on:

go
package main

import (
	"github.com/gramework/gramework"
)

func main() {
	app := gramework.New()

	app.GET("/", "hello, grameworld")

	app.ListenAndServe()
}

If you don't want to support the bind flag then pass the optional address argument to ListenAndServe.

NOTE: all examples below will register the bind flag.

JSON world ;) Part 1

From version: 1.1.0-rc1

The example below will serve {"hello":"grameworld"} from the map. Gramework will register the bind flag for you, that allows you to choose another ip/port that gramework should listen on:

go
package main

import (
	"github.com/gramework/gramework"
)

func main() {
	app := gramework.New()

	app.GET("/", func() map[string]interface{} {
		return map[string]interface{}{
			"hello": "gramework",
		}
	})

	app.ListenAndServe()
}

JSON world. Part 2

From version: 1.1.0-rc1

The example below will serve {"hello":"grameworld"} from the struct. Gramework will register the bind flag for you, that allows you to choose another ip/port that gramework should listen on:

go
package main

import (
	"github.com/gramework/gramework"
)

type SomeResponse struct {
	hello string
}

func main() {
	app := gramework.New()

	app.GET("/", func() interface{} {
		return SomeResponse{
			hello: "gramework",
		}
	})

	app.ListenAndServe()
}

Serving a dir

The example below will serve static files from ./files:

go
package main

import (
	"github.com/gramework/gramework"
)

func main() {
	app := gramework.New()

	app.GET("/*any", app.ServeDir("./files"))

	app.ListenAndServe()
}

Serving prepared bytes

The example below will serve a byte slice:

…

Using dynamic handlers, example 2. Simple FastHTTP-compatible handlers.

This example demonstrates how to migrate from fasthttp to gramework without rewriting your handlers.

go
package main

import (
	"github.com/gramework/gramework"
	"github.com/valyala/fasthttp"
)

func main() {
	app := gramework.New()

	app.GET("/someJSON", func(ctx *fasthttp.RequestCtx) {
		ctx.WriteString("another data")
	})

	app.ListenAndServe()
}

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Goeasy-to-usefastfasthttpframework

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库