Go 是一個快速增長的開源編程語言,用於構建簡單、快速和可靠的軟件。點這里看有哪些大公司在使用Go語言來構建他們的服務。
本文提供了所有必要的信息,以幫助開發人員了解使用Go語言開發Web應用程序的最佳選項。。
本文包含了最詳細的框架比較,通過盡可能多的角度(人氣,社區支持,內置功能等)來比較最知名的幾個Web 框架。
Gin: 一個Go語言寫的HTTP Web框架。它提供了Martini風格的API並有更好的性能。
* https://github.com/gin-gonic/gin
* https://gin-gonic.com/
Beego: 一個Go語言下開源的,高性能Web框架
* https://github.com/astaxie/beego
* https://beego.me
Echo: 一個高性能,極簡的Web框架
* https://github.com/labstack/echo
* https://echo.labstack.com
Iris: 目前發展最快的Go Web框架。提供完整的MVC功能並且面向未來。
* https://github.com/kataras/iris
* https://iris-go.com
Buffalo: 一個Go語言下快速Web開發框架
* https://github.com/gobuffalo/buffalo
* https://gobuffalo.io
Revel: 一個高生產率,全棧Go語言的Web框架。
* https://github.com/revel/revel
* https://revel.github.io
https://github.com/speedwheel/awesome-go-web-frameworks/blob/master/README.md
人氣指數
按人氣排序(star收藏數)
Name | Stars | Forks | Issues Open | Issues Closed | Birth Year | Latest Update | Author |
---|---|---|---|---|---|---|---|
Gin | 24,181 | 2,835 | 129 | 919 | 2014 | 2019-02-04 | @manucorporat |
Beego | 18,812 | 3,884 | 545 | 1,806 | 2012 | 2019-02-04 | @astaxie |
Iris | 13,565 | 1,406 | 19 | 621 | 2016 | 2019-01-16 | @kataras |
Echo | 12,861 | 1,141 | 14 | 779 | 2015 | 2019-02-07 | @vishr |
Revel | 10,723 | 1,302 | 58 | 806 | 2011 | 2018-10-30 | @revel |
Buffalo | 3,935 | 320 | 51 | 599 | 2014 | 2019-01-31 | @markbates |
學習曲線
Name | Examples | Reference | Real time support |
---|---|---|---|
Iris | 92 | https://github.com/kataras/iris/tree/master/_examples | rocket chat |
Beego | 49 | https://beego.me/docs | |
Echo | 20 | https://echo.labstack.com/cookbook/hello-world | |
Gin | 15 | https://github.com/gin-gonic/gin/tree/master/examples | gitter |
Revel | 6 | http://revel.github.io/examples/index.html | gitter |
Buffalo | 6 | https://gobuffalo.io/docs/installation | slack |
Great job by astaxie and kataras here, hopfully and the other frameworks will catch up with more examples, at least for me, if I switch to a new framework, that's the most resourceful place to quickly grasp as much information as possible. An example it's like 1000 words.
核心功能
按功能由多到少排序
Name | Iris | Beego | Revel | Echo | Gin | Buffalo |
---|---|---|---|---|---|---|
Router: Named Path Parameters & Wildcard* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Router: Regex* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Router: Grouping* | ![]() |
❔ | ❔ | ![]() |
![]() |
![]() |
Router: All the above Mixed Without Conflict* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Router: Custom HTTP Errors* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
100% compatible with net/http* | ![]() |
![]() |
![]() |
❔ | ![]() |
![]() |
Middleware ecosystem* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Sinatra-like API* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Server: Automatic HTTPS* | ![]() |
❔ | ![]() |
![]() |
![]() |
![]() |
Server: Gracefully Shutdown* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Server: Multi Listeners* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Full HTTP/2* | ![]() |
❔ | ❔ | ![]() |
standard | standard |
Subdomains* | ![]() |
secondary | secondary | secondary | secondary | secondary |
Sessions* | ![]() |
![]() |
![]() |
![]() |
![]() |
secondary |
Websockets* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
View (aka Templates) Embedded Into App* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
View Engine: STD* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
View Engine: Pug* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
View Engine: Django* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
View Engine: Handlebars* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
View Engine: Amber* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Renderer: Markdown, JSON, JSONP, XML...* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
MVC* | ![]() |
![]() |
generator | ![]() |
![]() |
![]() |
Caching* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
File Server* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
File Server: Embedded Into App* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Response can be Modified Many times through lifecycle before sent* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Gzip* | ![]() |
![]() |
![]() |
middleware | middleware | middleware |
Testing Framework* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Typescript Transpiler* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Online Editor* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Logging System* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Maintenance & Auto-Updates* | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Performance | ★★★★★ | ★★★ | ★★ | ★★★★★ | ★★★★★ | ★★★ |
The most known "Web frameworks" in Go are not really frameworks, meaning that:
Echo, Gin and Buffalo are not really (fully featured) web frameworks
but the majority of Go community thinks that they are.
Therefore they think that they are comparable with Iris, Beego or Revel,
because of that we have the obligation to include them into this list as well.
All of the above frameworks, except Beego and Revel, can adapt any middleware
that was created for net/http, some of those can do this with ease and others
with some hacking [even the pain is a choice here].
https://golangtc.com/t/56a38761b09ecc083100010c