go project layout
This is a simple clean architecture template with gin framework, fx as dependency container, gorm as orm for database related operations.
Implemented Features
- Dependency Injection (go-fx)
- Routing (gin web framework)
- Logging provides context trace(trace_id) and log file rotation (zap and lumberjack)
- Gin middlewares setup (cors, zap logger with custom log format)
- Database Setup (mysql)
- Models Setup and Automigrate (gorm with zap logger)
- Authentication (JWT)
- Migration Runner Implementation
- Cobra Commander CLI Support. try:
go run . --help
- Pprof setup with gin
Running the project
Have fun!