goat 是基于 gin 进行快速构建 RESTFUL API 的项目框架
go install github.com/togettoyou/goat/cmd/goatkit@latestOr
go get -u github.com/togettoyou/goat/cmd/goatkit# 创建项目模板
goatkit new helloworld
cd helloworld
# 运行程序
goatkit run
# 生成 swag 文档
goatkit swag
# 使用镜像代理
export GOAT_LAYOUT_REPO=https://github.com.cnpmjs.org/togettoyou/goat.git
goatkit new helloworld
# 更多帮助
goatkit -h
项目的依赖路径为: model 层 -> dao 层 -> svc 层 -> api 层
其中 model struct 串联各个层
router 层 负责路由注册