README ¶ golang-ddd-template a DDD project template in golang Web Framework: gin Middlewares Logging Library: zap Data Access Library xorm go-sql-driver Configuration Library: multiconfig Quick Start # download project generator go get -u github.com/jacexh/gdp@master gdp Change Log 0.2.6 参考Project Layout调整项目布局 0.2.5 Graceful Shutdown的exit code改成0 实现Domain Event 0.2.4 实现trace功能,确保request id可以在application、infra等层传递,可支持其他对象的传递 实现Graceful Shutdown 0.2.3 独立option模块,减少main.go文件代码量 配置文件移入./conf目录 0.2.2 使用xorm.io替换github.com/didi/gendry 升级gin/zap等依赖版本 dto <--> entity, do <--> entity 转换层更加显性地表达 0.2.1 区分DataObject以及Entity 修改目录名称 infrastructure/repository -> infrastructure/persistence 0.2.0 基于依赖反转原则以及六边形架构重构整个项目 层名称变更:sevice -> application,以及repository -> infrastructure Repository定义在Domain层内 Application+Domain 使用依赖反转,具备了更好的可测试性 更清晰的分支管理:master分支为golang项目,template分支为模板 严格区分了Entity、ValueObject、DataTransferObject、DomainEvent等 Expand ▾ Collapse ▴ Directories ¶ Show internal Expand all Path Synopsis api dto middleware v1 cmd internal application application/handler domain/event domain/user infrastructure/do infrastructure/persistence logger option trace pkg bytespool infection Click to show internal directories. Click to hide internal directories.