Scripts2026年7月1日·1 分钟阅读

Revel — High-Productivity MVC Web Framework for Go

Revel is a full-stack MVC web framework for Go that provides hot code reload, a comprehensive testing suite, and batteries-included modules for routing, validation, and templating.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Revel Web Framework
直接安装命令
npx -y tokrepo@latest install 9f9885bd-7568-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Revel is a full-stack web framework for Go that follows the MVC pattern. It draws inspiration from Play Framework and Ruby on Rails, aiming to provide a productive developer experience with hot code reload and convention-over-configuration defaults for Go web applications.

What Revel Does

  • Provides a complete MVC architecture with controllers, models, and templates
  • Offers automatic hot code reload during development without manual restarts
  • Includes a built-in testing framework for functional and unit tests
  • Ships with a routing engine that maps URLs to controller actions via a routes file
  • Bundles validation, session management, caching, and job scheduling out of the box

Architecture Overview

Revel runs as a self-contained server process. Incoming HTTP requests are matched against a compiled route table, dispatched to controller actions, and rendered through Go's html/template engine. The framework intercepts source changes via a file watcher and triggers a recompile-and-restart cycle transparently, giving a scripting-language feel to compiled Go code.

Self-Hosting & Configuration

  • Install via go install github.com/revel/cmd/revel@latest
  • Create a new project with revel new <app-name>
  • Configuration lives in conf/app.conf with INI-style key-value pairs
  • Set http.addr and http.port for binding; TLS via http.ssl.* keys
  • Deploy as a compiled binary with revel package for production

Key Features

  • Hot code reload removes the edit-compile-run loop in development
  • Convention-based project layout reduces boilerplate decisions
  • Built-in interceptors (filters) for cross-cutting concerns like auth and logging
  • Integrated parameter validation with struct tag annotations
  • Job scheduling module for background and periodic tasks

Comparison with Similar Tools

  • Gin — minimal router; Revel is a full MVC framework with more built-in modules
  • Echo — focused on REST APIs; Revel adds templates, sessions, and job scheduling
  • Beego — similar full-stack scope; Revel emphasizes hot reload and Play-style routing
  • Buffalo — comparable productivity focus; Revel has a longer track record
  • Fiber — high-performance micro framework; Revel trades raw speed for developer convenience

FAQ

Q: Does Revel support Go modules? A: Yes. Since Revel v1.0 the framework fully supports Go modules for dependency management.

Q: Is hot reload suitable for production? A: No. Hot reload is a development feature. For production, use revel package to build a static binary.

Q: Can I use a different template engine? A: Yes. Revel's rendering layer is pluggable; you can swap in Pongo2 or any engine that satisfies the template interface.

Q: How does routing work? A: Routes are defined in conf/routes using a simple format mapping HTTP methods and URL patterns to controller actions.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产