# Gomicro独立mod微服务框架v4版 **Repository Path**: trident-framework/gomicro-framework ## Basic Information - **Project Name**: Gomicro独立mod微服务框架v4版 - **Description**: Gomicro独立mod微服务框架【v4.9 ~ v4.11】 可运行golang版本【v1.18、v1.19、v1.20、v1.21、v1.22、1.23】 - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-10-21 - **Last Updated**: 2025-10-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Gomicro Framework A microservices framework based on Go Micro, including modules such as gateway, user service, product service, order service, inventory service, payment service, coupon service, content service, configuration center, registry center, message queue, distributed transactions, and more. ## Project Structure - **gateway-api**: Gateway service, providing API routing, authentication, rate limiting, circuit breaking, and other functionalities. - **services**: Microservices modules, including user service, product service, order service, etc. - **consoles**: Consumer console for processing messages in the RabbitMQ message queue. ``` golang-microgrpc-sharemod/ ├── gateway-api/ # 网关服务 | ├── config/ # 配置目录 | ├── constants/ # 常量目录 | ├── controllers/ # 控制器目录 | ├── logs/ # 日志目录 | ├── middlewares/ # 中间件目录 | ├── routers/ # 路由目录 | ├── static/ # 静态目录 | ├── tools/ # 工具目录 | ├── deploy.yaml # k8s部署文件 | ├── docker_compose_Jenkinsfile # docker-compose CICD文件 | ├── docker-compose.yaml # docker-compose部署文件 | ├── Dockerfile # 构建镜像文件 | ├── k8s_Jenkinsfile # k8s CICD文件 | ├── kubesphere_Jenkinsfile # kubesphere CICD文件 | ├── go.mod | ├── go.sum | └── main.go # 主文件 ├── services/ | ├── userService/ # 用户服务 | | ├── config/ # 配置目录 | | ├── constants/ # 常量目录 | | ├── handler/ # 处理器目录 | | ├── middlewares/ # 中间件目录 | | ├── logs/ # 日志目录 | | ├── models/ # 模型目录 | | ├── proto/ # proto目录 | | ├── tools/ # 工具目录 | | ├── deploy.yaml # k8s部署文件 | | ├── docker_compose_Jenkinsfile # docker-compose CICD文件 | | ├── docker-compose.yaml # docker-compose部署文件 | | ├── Dockerfile # 构建镜像文件 | | ├── k8s_Jenkinsfile # k8s CICD文件 | | ├── kubesphere_Jenkinsfile # kubesphere CICD文件 | | ├── go.mod | | ├── go.sum | | └── main.go # 主文件 └── README.md ``` ## Technology Stack - **Go**: Developed using the Go programming language. - **Go Micro**: Built microservices using the Go Micro framework. - **Gin**: Constructed the gateway service using the Gin framework. - **RabbitMQ**: Used RabbitMQ as the message queue. - **MySQL**: Used MySQL as the primary database. - **Redis**: Used Redis for caching and distributed locking. - **MongoDB**: Used MongoDB for storing unstructured data. - **ElasticSearch**: Used ElasticSearch for full-text search. - **MinIO/OSS**: Used MinIO or OSS for file storage. - **Nacos/Consul/ETCD**: Used Nacos, Consul, or ETCD as the configuration center and registry center. - **Sentinel**: Used Sentinel for traffic control and circuit breaking. - **Jaeger**: Used Jaeger for distributed tracing. - **Zap**: Used Zap for logging. ## Installation and Deployment ### Dependency Installation - Install Go 1.18+ - Install Docker - Install Docker Compose - Install Jenkins ### Project Deployment 1. **Clone the Project** ```bash git clone https://gitee.com/trident-framework/gomicro-framework.git cd gomicro-framework ``` 2. **Build Docker Images** ```bash docker-compose build ``` 3. **Start Services** ```bash docker-compose up -d ``` 4. **Access Jenkins** ```bash http://localhost:8080 ``` 5. **Configure Jenkins** - Create a new task and configure the build steps. - Use `Jenkinsfile` for continuous integration. ## Usage Instructions ### Gateway Service - **Start the Gateway Service** ```bash cd gateway-api go run main.go ``` - **Access the Gateway Service** ```bash http://localhost:8080 ``` ### User Service - **Start the User Service** ```bash cd services/userService go run main.go ``` - **Access the User Service** ```bash http://localhost:8081 ``` ### Product Service - **Start the Product Service** ```bash cd services/goodsService go run main.go ``` - **Access the Product Service** ```bash http://localhost:8082 ``` ### Order Service - **Start the Order Service** ```bash cd services/orderService go run main.go ``` - **Access the Order Service** ```bash http://localhost:8083 ``` ### Inventory Service - **Start the Inventory Service** ```bash cd services/inventoryService go run main.go ``` - **Access the Inventory Service** ```bash http://localhost:8084 ``` ### Payment Service - **Start the Payment Service** ```bash cd services/paymentService go run main.go ``` - **Access the Payment Service** ```bash http://localhost:8085 ``` ### Coupon Service - **Start the Coupon Service** ```bash cd services/couponService go run main.go ``` - **Access the Coupon Service** ```bash http://localhost:8086 ``` ### Content Service - **Start the Content Service** ```bash cd services/contentService go run main.go ``` - **Access the Content Service** ```bash http://localhost:8087 ``` ## Contribution Guide Code and documentation contributions are welcome. Please follow the steps below: 1. Fork this project. 2. Create a new branch. 3. Commit your code. 4. Create a Pull Request. ## License This project is licensed under the MIT License. For details, please refer to the [LICENSE](LICENSE) file.