Esta página se muestra en inglés. Una traducción al español está en curso.
ScriptsMay 25, 2026·3 min de lectura

GoFrame — Modular Full-Stack Web Framework for Go

GoFrame is a batteries-included Go framework providing HTTP server, ORM, caching, logging, configuration, and CLI scaffolding in one cohesive package.

Listo para agents

Este activo puede ser leído e instalado directamente por agents

TokRepo expone un comando CLI universal, contrato de instalación, metadata JSON, plan según adaptador y contenido raw para que los agents evalúen compatibilidad, riesgo y próximos pasos.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
GoFrame Overview
Comando CLI universal
npx tokrepo install 39e191a5-5837-11f1-9bc6-00163e2b0d79

Introduction

GoFrame (GF) is a comprehensive Go application framework that bundles an HTTP server, database ORM, caching, configuration management, and a development CLI. It targets teams building production web services who want convention over configuration without stitching together separate libraries.

What GoFrame Does

  • Provides a high-performance HTTP server with middleware and routing groups
  • Includes a full ORM with model generation, transactions, and soft deletes
  • Manages configuration from files, environment variables, and remote sources
  • Ships a CLI tool for project scaffolding, code generation, and database migration
  • Offers built-in modules for logging, validation, i18n, and scheduled tasks

Architecture Overview

GoFrame follows a modular monolith design where each subsystem (HTTP, ORM, cache, config, log) is an independent module behind a unified API. The core container provides dependency injection, and modules communicate through well-defined interfaces. The ORM uses a chainable query builder on top of database/sql with driver adapters for MySQL, PostgreSQL, SQLite, and others.

Self-Hosting & Configuration

  • Install the CLI: go install github.com/gogf/gf/cmd/gf/v2@latest
  • Scaffold a project: gf init projectname
  • Configure via manifest/config/config.yaml for server, database, and logging
  • Generate model and DAO code from database tables: gf gen dao
  • Deploy as a single binary; use gf build for cross-platform compilation

Key Features

  • Unified framework reduces dependency management overhead
  • Code generation accelerates CRUD development with type-safe models
  • Context-aware logging and tracing integrate with OpenTelemetry
  • Modular design allows using individual components without the full framework
  • Active Chinese and English documentation with growing community

Comparison with Similar Tools

  • Gin — Lightweight HTTP router only; GoFrame provides ORM, config, and CLI on top
  • Beego — Similar full-stack approach but GoFrame has a more modern API and active maintenance
  • Echo — Focused on HTTP middleware; lacks built-in ORM and code generation
  • Kratos — Microservices-oriented with gRPC focus; GoFrame targets monolithic and modular apps

FAQ

Q: Is GoFrame suitable for microservices? A: Yes. Its modular design lets you use only the HTTP and gRPC components for lightweight services.

Q: How does the ORM compare to GORM? A: GoFrame ORM is tightly integrated with the framework and offers code generation. GORM is standalone and more widely adopted outside GoFrame projects.

Q: Can I use GoFrame with an existing Go project? A: Yes. Individual modules like the HTTP server or ORM can be imported independently.

Q: What databases does GoFrame support? A: MySQL, PostgreSQL, SQLite, Oracle, SQL Server, and ClickHouse via community drivers.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados