mirror of
https://github.com/zhufuyi/sponge.git
synced 2024-05-03 09:44:53 +08:00
sponge is a powerful code generation tool, a microservices framework based on gin and gRPC.
api | ||
build | ||
cmd/serverNameExample | ||
configs | ||
deployments | ||
docs | ||
internal | ||
pkg | ||
scripts | ||
test | ||
third_party | ||
.gitignore | ||
.golangci.yml | ||
doc.go | ||
go.mod | ||
go.sum | ||
Jenkinsfile | ||
LICENSE | ||
Makefile | ||
README.md |
sponge
sponge 是一个微服务框架,支持http和grpc及服务治理,支持代码自动生成。
功能:
- web框架 gin
- rpc框架 grpc
- 配置文件解析 viper
- 日志 zap
- 数据库组件 gorm
- 缓存组件 go-redis
- 生成文档 swagger
- 校验器 validator
- 链路跟踪 opentelemetry
- 指标采集 prometheus
- 限流 ratelimiter
- 熔断 hystrix
- 包管理工具 go modules
- 性能分析 go profile
- 代码检测 golangci-lint
目录结构
目录结构遵循golang-standards/project-layout。
├── cmd # 应用程序的目录
├── config # 配置文件目录
├── docs # 设计和用户文档
├── internal # 私有应用程序和库代码
│ ├── cache # 基于业务封装的cache
│ ├── dao # 数据访问
│ ├── ecode # 自定义业务错误码
│ ├── handler # http的业务功能实现
│ ├── model # 数据库 model
│ ├── routers # http 路由
│ ├── server # 服务入口,包括http和grpc服务
│ └── service # grpc的业务功能实现
├── pkg # 外部应用程序可以使用的库代码
├── scripts # 存放用于执行各种构建,安装,分析等操作的脚本
├── third_party # 外部辅助工具,分叉代码和其他第三方工具
├── test # 额外的外部测试应用程序和测试数据
├── build # 打包和持续集成
└── deployments # IaaS、PaaS、系统和容器编排部署配置和模板
运行
make run