# go-zero-all-demos **Repository Path**: hacker__007/go-zero-all-demos ## Basic Information - **Project Name**: go-zero-all-demos - **Description**: No description available - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-05-14 - **Last Updated**: 2025-05-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # go-zero all demos ### 使用技术栈 * go-zero rpc 服务 * go-zero api 服务 * gorm 数据库 ORM * mysql 集群 * redis 缓存集群 * consul 服务发现 * nacos 配置中心 * jaeger 链路追踪 * prometheus 监控 * grafana 监控面板 * docker 容器化 * nomad 服务编排 #### 用户服务 创建 user.sql 生成基于 GORM 的数据模型 goctl model mysql ddl --src user.sql --dir ./models -cache --home ..\..\template --style go_zero 创建 user.proto 生成基于 protobuf 的 rpc 服务 goctl rpc protoc user.proto --go_out=./pb --go-grpc_out=./pb --zrpc_out=./rpc --style=go_zero cd ../api 创建 user.api 生成基于 http 的 api 服务 goctl api go --api user.api --style go_zero --dir . #### 订单服务 创建 order.sql 生成基于 GORM 的数据模型 goctl model mysql ddl --src order.sql --dir ./models -cache --home ..\..\template --style go_zero 创建 order.proto 生成基于 protobuf 的 rpc 服务 goctl rpc protoc order.proto --go_out=./pb --go-grpc_out=./pb --zrpc_out=./rpc --style=go_zero cd../api 创建 order.api 生成基于 http 的 api 服务 goctl api go --api order.api --style go_zero --dir . #### k6 压测工具的使用 mac: brew install k6 ubuntu: sudo snap install k6