Go 的全栈 Web 框架,Revel v0.11.2 发布
Revel 是一个Go 语言高效的,全栈Web开发框架,灵感源于Rails 和 Play!。
特性
Hot Code Reload
Edit, save, and refresh. Revel compiles your code and templates for you, so you don't miss a beat. Code doesn't compile? It gives you a helpful description. Run-time code panic? Revel has you covered.
Comprehensive
Revel provides routing, parameter parsing, validation, session/flash, templating, caching, job running, a testing framework, and even internationalization.
High Performance
Revel builds on top of the Go HTTP server, which was recently benchmarked to serve three to ten times as many requests as Rails across a variety of loads.
Framework Design
Synchronous
The Go HTTP server runs each request in its own goroutine. Write simple callback-free code without guilt.
Stateless
Revel provides primitives that keep the web tier stateless for predictable scaling. For example, session data is stored in the user cookie, and the cache is backed by a memcached cluster.
Modular
Revel is built around composable middleware called filters, which implement nearly all request-processing functionality. Developers have the freedom to replace the default filters with custom implementations (e.g. a custom router).
Revel v0.11.2 发布,此版本修复了一个重要的 bug,强烈建议每位用户用最新的 Revel 版本重建项目,升级请执行:
$ go get -u github.com/revel/cmd/revel $ revel build github.com/myusername/myproject /path/to/destination/folder
此版本现已提供下载。
// app/controllers/app.go type Application struct { *rev.Controller } func (c Application) Register() rev.Result { title := "Register" return c.Render(title) } func (c Application) SaveUser(user models.User, verifyPassword string) rev.Result { c.Validation.Required(verifyPassword).Key("verifyPassword") c.Validation.Required(verifyPassword == user.Password).Key("verifyPassword"). Message("Password does not match") user.Validate(c.Validation) if c.Validation.HasErrors() { c.Validation.Keep() c.FlashParams() return c.Redirect(Application.Register) } _, err := c.Txn.Exec("insert into User (Username, Password, Name) values (?, ?, ?)", user.Username, user.Password, user.Name) if err != nil { panic(err) } c.Session["user"] = user.Username c.Flash.Success("Welcome, " + user.Name) return c.Redirect(Hotels.Index) }
相关资讯
- Go 的全栈 Web 框架,Revel v0.11.2 发布
- Go 的全栈 Web 框架,Revel v0.12.0 发布
- Go 的全堆栈 Web 框架,Revel v0.11.3 发布
- 所谓全栈 - 《Web全栈工程师的自我修养》读书笔记
- TreeFrog Framework 1.6.1 发布,C++的全栈Web框架
- TreeFrog Framework 1.7.1 发布,C++的全栈Web框架
- TreeFrog Framework 1.7.3 发布,C++的全栈Web框架
- 从全栈工程师到全栈整合师:再见,Web2.0时代的英雄
- 全栈Ruby框架,Lotus v0.4.0 发布
- 高速和全栈C++框架,TreeFrog Framework 1.0.2 发布