Goe is a modern Go application framework that combines best practices from leading frameworks and libraries. Built entirely on Uber's Fx dependency injection framework and leveraging GoFiber for its HTTP layer, Goe prioritizes developer experience, modularity, extensibility, and concurrent safety.
It aims to provide a solid foundation for building robust and scalable Go applications with ease. 😊
- 🔌 Powerful Dependency Injection: Built on Uber's Fx for type-safe management of application components and lifecycle.
- 🌐 High-Performance HTTP Server: Integrated with GoFiber v3, featuring automatic request logging, middleware support, and fast routing.
- 📝 Structured & Flexible Logging: Utilizes Uber's Zap logger with developer-friendly console output and production-ready JSON formatting.
- ⚙️ Environment-Aware Configuration: Load configuration from environment variables and
.envfiles, with type-safe accessors. - 💾 Versatile Cache Support: Unified caching interface via Fiber's storage, supporting drivers like Memory, Redis, SQLite, etc.
- 🧩 Extensible Module System: Organize your application into logical modules with managed lifecycles (
OnStart,OnStop). - 🛡️ Contract-Driven Design: Core components are defined by interfaces, promoting loose coupling and testability.
- 🎯 Intuitive Developer Experience: Offers both simple global accessors for convenience and full support for explicit dependency injection.
- 🔄 Concurrency Safety: Core framework components are designed to be safe for concurrent use.
- 🗄️ GORM Database Integration: Seamless integration with GORM for database operations, supporting multiple SQL drivers.
Install the dependency:
go get go.oease.dev/goe/v2Create a minimal application (main.go):
package main
import (
"github.com/gofiber/fiber/v3"
"go.oease.dev/goe/v2"
"go.oease.dev/goe/v2/contract"
)
func main() {
// Initialize Goe with the HTTP module enabled
_ = goe.New(goe.Options{
WithHTTP: true,
Invokers: []any{ // Use Fx invoker to register routes
func(httpKernel contract.HTTPKernel, logger contract.Logger) {
app := httpKernel.App()
app.Get("/", func(c fiber.Ctx) error {
logger.Info("Hello endpoint was hit!")
return c.SendString("Hello, World from Goe! 👋")
})
logger.Info("Main route registered.")
},
},
})
// Start the application (blocks until shutdown)
goe.Run()
}For a detailed step-by-step guide, please see our full Getting Started documentation.
Our new and comprehensive developer documentation is available in the docs/ directory.
It covers everything from getting started, architecture, configuration, core modules (HTTP, DB, Cache, Logging), advanced topics like custom modules and dependency injection, to best practices and deployment.
➡️ Start exploring the documentation here! ⬅️
Contributions are welcome and greatly appreciated! Please see the Contributing Guide for
details on how to get started, including setting up your environment, running tests (go test ./...), and submitting
pull requests.
We adhere to a Code of Conduct to ensure a welcoming community.
Goe is released under the MIT License.