代码拉取完成,页面将自动刷新
Highly concurrent mall system built on go-zero
Name | Description | Link |
---|---|---|
Go-Zero | Web & Rpc Go Frame | https://go-zero.dev/cn/ |
Mysql | DB | https://www.mysql.com/ |
Redis | Cache | https://redis.io/ |
Docker | Code Runtime Environment | https://www.docker.com/ |
MQ |
server name | port |
---|---|
api bff | 8001 |
server name | port |
---|---|
user rpc | 9001 |
product rpc | 9002 |
order rpc | 9003 |
reply rpc | 9004 |
app - BFF服务
cart - 购物车服务
rpc - 订单服务
pay - 支付服务
rpc - 商品服务
recommend - 推荐服务
reply - 评论服务
user - 账号服务
api - 对外的BFF服务,接受来自客户端的请求,暴露HTTP接口
rpc - 对内的微服务,仅接受来自内部其他微服务或者BFF的请求,暴露gRPC接口
rmq - 负责进行流式任务处理,上游一般依赖消息队列,比如kafka等
admin - 也是对内的服务,区别于rpc,更多的是面向运营侧的且数据权限较高,通过隔离可带来更好的代码级别的安全,直接提供HTTP接口
代码生成命令
# 在sql同目录下运行:
goctl model mysql ddl -src ./order.sql -dir ./ -c
# 在api同目录下运行:
goctl api go -api ./order.api -dir ./
# 在rpc同目录下运行:
goctl rpc protoc order.proto --go_out=. --go-grpc_out=. --zrpc_out=.
启动服务
# 启动 order rpc 服务
go run order.go -f etc/order.yaml
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。