Ourea Desc Dependency Injection And Simplified version DDD
Ourea Source Code Is Licensed Under the Apache Licence, Version 2.0
官网:https://ourea.vip
Ourea Go framework 是一个小巧但功能在不断完善的Go框架。
快速开始
版本要求
Go >= V1.15
作者
Dev:Houhuiyang
安装
git clone https://github.com/hayes-hou/ourea.git
go build -o ourea cmd/main.go
./ourea
使用到的开源软件
* 压测工具:
git clone https://github.com/link1st/go-stress-testing
./go-stress-testing -c 20 -n 1 -u http://api.ourea.vip/api_customer
* 数据库:
mongo:brew services start mongodb/brew/mongodb-community
mysql:mysql.server start
redis:nohup redis-server &
版本
Releases Tag: V0.0.2 https://github.com/hayes-hou/ourea/archive/refs/tags/v0.0.2.zip
Beate Tag: V0.0.3
Ourea社区
稍后提供
构建您的第一个应用
Demo
[Ourea API](http://api.ourea.vip/api_customer)
[Go Pprof](http://api.ourea.vip/debug/pprof/)
[Swagger](http://api.ourea.vip/swagger/index.html)
进入:ourea/internal/modules/http/controllers/index.go
Customer具体书写:
service.RegCustomerService, // Service
regCustomerController, // Controller
脚手架
稍后提供
常规主题
目录结构
.
├── README.md
├── cmd 启动程序
│ └── main.go
├── config 配置加载
│ ├── config.go
│ ├── init.go
│ └── pid.txt
├── deploy 部署文件
│ └── readme.md
├── dev.yaml 配置文件
├── docs 文档
│ ├── readme.md
│ └── upload_img.sql
├── go.mod
├── go.sum
├── infrastructure 基础设施层
│ ├── cache
│ │ └── redis.go
│ ├── db
│ │ └── mysql.go
│ ├── mongo
│ │ └── mongo.go
│ └── readme.md
├── internal 内部应用层
│ ├── domain 领域层
│ │ ├── entity
│ │ │ └── customer.go
│ │ ├── readme.md
│ │ ├── repository
│ │ │ └── mongo.go
│ │ └── service
│ │ └── customer.go
│ ├── modules 模块
│ │ ├── http
│ │ │ ├── base
│ │ │ │ └── gin.go
│ │ │ ├── controllers
│ │ │ │ ├── customer.go
│ │ │ │ ├── index.go
│ │ │ │ └── response.go
│ │ │ ├── index.go
│ │ │ ├── middleware
│ │ │ │ ├── cors.go
│ │ │ │ ├── hystrix.go
│ │ │ │ ├── limiter.go
│ │ │ │ ├── logger.go
│ │ │ │ └── recover.go
│ │ │ └── router
│ │ │ ├── customer.go
│ │ │ ├── index.go
│ │ │ └── router.go
│ │ ├── logger
│ │ │ └── index.go
│ │ └── system
│ │ └── close.go
│ ├── readme.md
│ └── service
│ └── readme.md
├── logs
│ └── run.log
├── pkg
│ ├── header
│ │ └── hearder.go
│ └── readme.md
└── tests
└── readme.md
配置文件
dev.yaml 配置
中间件
cors.go 跨域
hystrix.go 熔断
limiter.go 限流器
logger.go 日志
recover.go 异常捕获
链路追踪
Gin/Gorm已经加入 RequestId/SpanId
{"level":"info","msg":"sql/Users/houhuiyang/go/src/ourea/internal/domain/service/customer.go:509.984083msSELECt * FROM `upload_img` WHERe `upload_img`.`deleted_at` IS NULL[] 2","requestId":"navigate","spanId":"navigate","time":"2021-11-23 14:19:57"}
{"clientIp":"127.0.0.1","latencyTime":17093224,"level":"info","module":"gin","msg":"","reqMethod":"GET","reqUri":"/api_customer","requestId":"navigate","spanId":"navigate","statusCode":200,"time":"2021-11-23 14:19:57"}
案例
川峡商机 https://www.618.cx
Copyright (c) 2021 ~ 2022 Ourea Go framework By houhuiyang@2021-11-23
Go >= V1.15
作者
Dev:Houhuiyang
安装
git clone https://github.com/hayes-hou/ourea.git
go build -o ourea cmd/main.go
./ourea
使用到的开源软件
* 压测工具:
git clone https://github.com/link1st/go-stress-testing
./go-stress-testing -c 20 -n 1 -u http://api.ourea.vip/api_customer
* 数据库:
mongo:brew services start mongodb/brew/mongodb-community
mysql:mysql.server start
redis:nohup redis-server &
版本
Releases Tag: V0.0.2 https://github.com/hayes-hou/ourea/archive/refs/tags/v0.0.2.zip
Beate Tag: V0.0.3
Ourea社区
稍后提供
构建您的第一个应用
Demo
[Ourea API](http://api.ourea.vip/api_customer)
[Go Pprof](http://api.ourea.vip/debug/pprof/)
[Swagger](http://api.ourea.vip/swagger/index.html)
进入:ourea/internal/modules/http/controllers/index.go
Customer具体书写:
service.RegCustomerService, // Service
regCustomerController, // Controller
脚手架
稍后提供
常规主题
目录结构
.
├── README.md
├── cmd 启动程序
│ └── main.go
├── config 配置加载
│ ├── config.go
│ ├── init.go
│ └── pid.txt
├── deploy 部署文件
│ └── readme.md
├── dev.yaml 配置文件
├── docs 文档
│ ├── readme.md
│ └── upload_img.sql
├── go.mod
├── go.sum
├── infrastructure 基础设施层
│ ├── cache
│ │ └── redis.go
│ ├── db
│ │ └── mysql.go
│ ├── mongo
│ │ └── mongo.go
│ └── readme.md
├── internal 内部应用层
│ ├── domain 领域层
│ │ ├── entity
│ │ │ └── customer.go
│ │ ├── readme.md
│ │ ├── repository
│ │ │ └── mongo.go
│ │ └── service
│ │ └── customer.go
│ ├── modules 模块
│ │ ├── http
│ │ │ ├── base
│ │ │ │ └── gin.go
│ │ │ ├── controllers
│ │ │ │ ├── customer.go
│ │ │ │ ├── index.go
│ │ │ │ └── response.go
│ │ │ ├── index.go
│ │ │ ├── middleware
│ │ │ │ ├── cors.go
│ │ │ │ ├── hystrix.go
│ │ │ │ ├── limiter.go
│ │ │ │ ├── logger.go
│ │ │ │ └── recover.go
│ │ │ └── router
│ │ │ ├── customer.go
│ │ │ ├── index.go
│ │ │ └── router.go
│ │ ├── logger
│ │ │ └── index.go
│ │ └── system
│ │ └── close.go
│ ├── readme.md
│ └── service
│ └── readme.md
├── logs
│ └── run.log
├── pkg
│ ├── header
│ │ └── hearder.go
│ └── readme.md
└── tests
└── readme.md
配置文件
dev.yaml 配置
中间件
cors.go 跨域
hystrix.go 熔断
limiter.go 限流器
logger.go 日志
recover.go 异常捕获
链路追踪
Gin/Gorm已经加入 RequestId/SpanId
{"level":"info","msg":"sql/Users/houhuiyang/go/src/ourea/internal/domain/service/customer.go:509.984083msSELECt * FROM `upload_img` WHERe `upload_img`.`deleted_at` IS NULL[] 2","requestId":"navigate","spanId":"navigate","time":"2021-11-23 14:19:57"}
{"clientIp":"127.0.0.1","latencyTime":17093224,"level":"info","module":"gin","msg":"","reqMethod":"GET","reqUri":"/api_customer","requestId":"navigate","spanId":"navigate","statusCode":200,"time":"2021-11-23 14:19:57"}
案例
川峡商机 https://www.618.cx
Copyright (c) 2021 ~ 2022 Ourea Go framework By houhuiyang@2021-11-23
git clone https://github.com/hayes-hou/ourea.git go build -o ourea cmd/main.go ./ourea
使用到的开源软件
* 压测工具:
git clone https://github.com/link1st/go-stress-testing
./go-stress-testing -c 20 -n 1 -u http://api.ourea.vip/api_customer
* 数据库:
mongo:brew services start mongodb/brew/mongodb-community
mysql:mysql.server start
redis:nohup redis-server &
版本
Releases Tag: V0.0.2 https://github.com/hayes-hou/ourea/archive/refs/tags/v0.0.2.zip
Beate Tag: V0.0.3
Ourea社区
稍后提供
构建您的第一个应用
Demo
[Ourea API](http://api.ourea.vip/api_customer)
[Go Pprof](http://api.ourea.vip/debug/pprof/)
[Swagger](http://api.ourea.vip/swagger/index.html)
进入:ourea/internal/modules/http/controllers/index.go
Customer具体书写:
service.RegCustomerService, // Service
regCustomerController, // Controller
脚手架
稍后提供
常规主题
目录结构
.
├── README.md
├── cmd 启动程序
│ └── main.go
├── config 配置加载
│ ├── config.go
│ ├── init.go
│ └── pid.txt
├── deploy 部署文件
│ └── readme.md
├── dev.yaml 配置文件
├── docs 文档
│ ├── readme.md
│ └── upload_img.sql
├── go.mod
├── go.sum
├── infrastructure 基础设施层
│ ├── cache
│ │ └── redis.go
│ ├── db
│ │ └── mysql.go
│ ├── mongo
│ │ └── mongo.go
│ └── readme.md
├── internal 内部应用层
│ ├── domain 领域层
│ │ ├── entity
│ │ │ └── customer.go
│ │ ├── readme.md
│ │ ├── repository
│ │ │ └── mongo.go
│ │ └── service
│ │ └── customer.go
│ ├── modules 模块
│ │ ├── http
│ │ │ ├── base
│ │ │ │ └── gin.go
│ │ │ ├── controllers
│ │ │ │ ├── customer.go
│ │ │ │ ├── index.go
│ │ │ │ └── response.go
│ │ │ ├── index.go
│ │ │ ├── middleware
│ │ │ │ ├── cors.go
│ │ │ │ ├── hystrix.go
│ │ │ │ ├── limiter.go
│ │ │ │ ├── logger.go
│ │ │ │ └── recover.go
│ │ │ └── router
│ │ │ ├── customer.go
│ │ │ ├── index.go
│ │ │ └── router.go
│ │ ├── logger
│ │ │ └── index.go
│ │ └── system
│ │ └── close.go
│ ├── readme.md
│ └── service
│ └── readme.md
├── logs
│ └── run.log
├── pkg
│ ├── header
│ │ └── hearder.go
│ └── readme.md
└── tests
└── readme.md
配置文件
dev.yaml 配置
中间件
cors.go 跨域
hystrix.go 熔断
limiter.go 限流器
logger.go 日志
recover.go 异常捕获
链路追踪
Gin/Gorm已经加入 RequestId/SpanId
{"level":"info","msg":"sql/Users/houhuiyang/go/src/ourea/internal/domain/service/customer.go:509.984083msSELECt * FROM `upload_img` WHERe `upload_img`.`deleted_at` IS NULL[] 2","requestId":"navigate","spanId":"navigate","time":"2021-11-23 14:19:57"}
{"clientIp":"127.0.0.1","latencyTime":17093224,"level":"info","module":"gin","msg":"","reqMethod":"GET","reqUri":"/api_customer","requestId":"navigate","spanId":"navigate","statusCode":200,"time":"2021-11-23 14:19:57"}
案例
川峡商机 https://www.618.cx
Copyright (c) 2021 ~ 2022 Ourea Go framework By houhuiyang@2021-11-23
Releases Tag: V0.0.2 https://github.com/hayes-hou/ourea/archive/refs/tags/v0.0.2.zip Beate Tag: V0.0.3
Ourea社区
稍后提供
构建您的第一个应用
Demo
[Ourea API](http://api.ourea.vip/api_customer)
[Go Pprof](http://api.ourea.vip/debug/pprof/)
[Swagger](http://api.ourea.vip/swagger/index.html)
进入:ourea/internal/modules/http/controllers/index.go
Customer具体书写:
service.RegCustomerService, // Service
regCustomerController, // Controller
脚手架
稍后提供
常规主题
目录结构
.
├── README.md
├── cmd 启动程序
│ └── main.go
├── config 配置加载
│ ├── config.go
│ ├── init.go
│ └── pid.txt
├── deploy 部署文件
│ └── readme.md
├── dev.yaml 配置文件
├── docs 文档
│ ├── readme.md
│ └── upload_img.sql
├── go.mod
├── go.sum
├── infrastructure 基础设施层
│ ├── cache
│ │ └── redis.go
│ ├── db
│ │ └── mysql.go
│ ├── mongo
│ │ └── mongo.go
│ └── readme.md
├── internal 内部应用层
│ ├── domain 领域层
│ │ ├── entity
│ │ │ └── customer.go
│ │ ├── readme.md
│ │ ├── repository
│ │ │ └── mongo.go
│ │ └── service
│ │ └── customer.go
│ ├── modules 模块
│ │ ├── http
│ │ │ ├── base
│ │ │ │ └── gin.go
│ │ │ ├── controllers
│ │ │ │ ├── customer.go
│ │ │ │ ├── index.go
│ │ │ │ └── response.go
│ │ │ ├── index.go
│ │ │ ├── middleware
│ │ │ │ ├── cors.go
│ │ │ │ ├── hystrix.go
│ │ │ │ ├── limiter.go
│ │ │ │ ├── logger.go
│ │ │ │ └── recover.go
│ │ │ └── router
│ │ │ ├── customer.go
│ │ │ ├── index.go
│ │ │ └── router.go
│ │ ├── logger
│ │ │ └── index.go
│ │ └── system
│ │ └── close.go
│ ├── readme.md
│ └── service
│ └── readme.md
├── logs
│ └── run.log
├── pkg
│ ├── header
│ │ └── hearder.go
│ └── readme.md
└── tests
└── readme.md
配置文件
dev.yaml 配置
中间件
cors.go 跨域
hystrix.go 熔断
limiter.go 限流器
logger.go 日志
recover.go 异常捕获
链路追踪
Gin/Gorm已经加入 RequestId/SpanId
{"level":"info","msg":"sql/Users/houhuiyang/go/src/ourea/internal/domain/service/customer.go:509.984083msSELECt * FROM `upload_img` WHERe `upload_img`.`deleted_at` IS NULL[] 2","requestId":"navigate","spanId":"navigate","time":"2021-11-23 14:19:57"}
{"clientIp":"127.0.0.1","latencyTime":17093224,"level":"info","module":"gin","msg":"","reqMethod":"GET","reqUri":"/api_customer","requestId":"navigate","spanId":"navigate","statusCode":200,"time":"2021-11-23 14:19:57"}
案例
川峡商机 https://www.618.cx
Copyright (c) 2021 ~ 2022 Ourea Go framework By houhuiyang@2021-11-23
Demo
[Ourea API](http://api.ourea.vip/api_customer)
[Go Pprof](http://api.ourea.vip/debug/pprof/)
[Swagger](http://api.ourea.vip/swagger/index.html)
进入:ourea/internal/modules/http/controllers/index.go
Customer具体书写:
service.RegCustomerService, // Service
regCustomerController, // Controller
脚手架
稍后提供
常规主题
目录结构
.
├── README.md
├── cmd 启动程序
│ └── main.go
├── config 配置加载
│ ├── config.go
│ ├── init.go
│ └── pid.txt
├── deploy 部署文件
│ └── readme.md
├── dev.yaml 配置文件
├── docs 文档
│ ├── readme.md
│ └── upload_img.sql
├── go.mod
├── go.sum
├── infrastructure 基础设施层
│ ├── cache
│ │ └── redis.go
│ ├── db
│ │ └── mysql.go
│ ├── mongo
│ │ └── mongo.go
│ └── readme.md
├── internal 内部应用层
│ ├── domain 领域层
│ │ ├── entity
│ │ │ └── customer.go
│ │ ├── readme.md
│ │ ├── repository
│ │ │ └── mongo.go
│ │ └── service
│ │ └── customer.go
│ ├── modules 模块
│ │ ├── http
│ │ │ ├── base
│ │ │ │ └── gin.go
│ │ │ ├── controllers
│ │ │ │ ├── customer.go
│ │ │ │ ├── index.go
│ │ │ │ └── response.go
│ │ │ ├── index.go
│ │ │ ├── middleware
│ │ │ │ ├── cors.go
│ │ │ │ ├── hystrix.go
│ │ │ │ ├── limiter.go
│ │ │ │ ├── logger.go
│ │ │ │ └── recover.go
│ │ │ └── router
│ │ │ ├── customer.go
│ │ │ ├── index.go
│ │ │ └── router.go
│ │ ├── logger
│ │ │ └── index.go
│ │ └── system
│ │ └── close.go
│ ├── readme.md
│ └── service
│ └── readme.md
├── logs
│ └── run.log
├── pkg
│ ├── header
│ │ └── hearder.go
│ └── readme.md
└── tests
└── readme.md
配置文件
dev.yaml 配置
中间件
cors.go 跨域
hystrix.go 熔断
limiter.go 限流器
logger.go 日志
recover.go 异常捕获
链路追踪
Gin/Gorm已经加入 RequestId/SpanId
{"level":"info","msg":"sql/Users/houhuiyang/go/src/ourea/internal/domain/service/customer.go:509.984083msSELECt * FROM `upload_img` WHERe `upload_img`.`deleted_at` IS NULL[] 2","requestId":"navigate","spanId":"navigate","time":"2021-11-23 14:19:57"}
{"clientIp":"127.0.0.1","latencyTime":17093224,"level":"info","module":"gin","msg":"","reqMethod":"GET","reqUri":"/api_customer","requestId":"navigate","spanId":"navigate","statusCode":200,"time":"2021-11-23 14:19:57"}
案例
川峡商机 https://www.618.cx
Copyright (c) 2021 ~ 2022 Ourea Go framework By houhuiyang@2021-11-23
稍后提供
常规主题
目录结构
.
├── README.md
├── cmd 启动程序
│ └── main.go
├── config 配置加载
│ ├── config.go
│ ├── init.go
│ └── pid.txt
├── deploy 部署文件
│ └── readme.md
├── dev.yaml 配置文件
├── docs 文档
│ ├── readme.md
│ └── upload_img.sql
├── go.mod
├── go.sum
├── infrastructure 基础设施层
│ ├── cache
│ │ └── redis.go
│ ├── db
│ │ └── mysql.go
│ ├── mongo
│ │ └── mongo.go
│ └── readme.md
├── internal 内部应用层
│ ├── domain 领域层
│ │ ├── entity
│ │ │ └── customer.go
│ │ ├── readme.md
│ │ ├── repository
│ │ │ └── mongo.go
│ │ └── service
│ │ └── customer.go
│ ├── modules 模块
│ │ ├── http
│ │ │ ├── base
│ │ │ │ └── gin.go
│ │ │ ├── controllers
│ │ │ │ ├── customer.go
│ │ │ │ ├── index.go
│ │ │ │ └── response.go
│ │ │ ├── index.go
│ │ │ ├── middleware
│ │ │ │ ├── cors.go
│ │ │ │ ├── hystrix.go
│ │ │ │ ├── limiter.go
│ │ │ │ ├── logger.go
│ │ │ │ └── recover.go
│ │ │ └── router
│ │ │ ├── customer.go
│ │ │ ├── index.go
│ │ │ └── router.go
│ │ ├── logger
│ │ │ └── index.go
│ │ └── system
│ │ └── close.go
│ ├── readme.md
│ └── service
│ └── readme.md
├── logs
│ └── run.log
├── pkg
│ ├── header
│ │ └── hearder.go
│ └── readme.md
└── tests
└── readme.md
配置文件
dev.yaml 配置
中间件
cors.go 跨域
hystrix.go 熔断
limiter.go 限流器
logger.go 日志
recover.go 异常捕获
链路追踪
Gin/Gorm已经加入 RequestId/SpanId
{"level":"info","msg":"sql/Users/houhuiyang/go/src/ourea/internal/domain/service/customer.go:509.984083msSELECt * FROM `upload_img` WHERe `upload_img`.`deleted_at` IS NULL[] 2","requestId":"navigate","spanId":"navigate","time":"2021-11-23 14:19:57"}
{"clientIp":"127.0.0.1","latencyTime":17093224,"level":"info","module":"gin","msg":"","reqMethod":"GET","reqUri":"/api_customer","requestId":"navigate","spanId":"navigate","statusCode":200,"time":"2021-11-23 14:19:57"}
案例
川峡商机 https://www.618.cx
Copyright (c) 2021 ~ 2022 Ourea Go framework By houhuiyang@2021-11-23
.
├── README.md
├── cmd 启动程序
│ └── main.go
├── config 配置加载
│ ├── config.go
│ ├── init.go
│ └── pid.txt
├── deploy 部署文件
│ └── readme.md
├── dev.yaml 配置文件
├── docs 文档
│ ├── readme.md
│ └── upload_img.sql
├── go.mod
├── go.sum
├── infrastructure 基础设施层
│ ├── cache
│ │ └── redis.go
│ ├── db
│ │ └── mysql.go
│ ├── mongo
│ │ └── mongo.go
│ └── readme.md
├── internal 内部应用层
│ ├── domain 领域层
│ │ ├── entity
│ │ │ └── customer.go
│ │ ├── readme.md
│ │ ├── repository
│ │ │ └── mongo.go
│ │ └── service
│ │ └── customer.go
│ ├── modules 模块
│ │ ├── http
│ │ │ ├── base
│ │ │ │ └── gin.go
│ │ │ ├── controllers
│ │ │ │ ├── customer.go
│ │ │ │ ├── index.go
│ │ │ │ └── response.go
│ │ │ ├── index.go
│ │ │ ├── middleware
│ │ │ │ ├── cors.go
│ │ │ │ ├── hystrix.go
│ │ │ │ ├── limiter.go
│ │ │ │ ├── logger.go
│ │ │ │ └── recover.go
│ │ │ └── router
│ │ │ ├── customer.go
│ │ │ ├── index.go
│ │ │ └── router.go
│ │ ├── logger
│ │ │ └── index.go
│ │ └── system
│ │ └── close.go
│ ├── readme.md
│ └── service
│ └── readme.md
├── logs
│ └── run.log
├── pkg
│ ├── header
│ │ └── hearder.go
│ └── readme.md
└── tests
└── readme.md
配置文件
dev.yaml 配置
中间件
cors.go 跨域
hystrix.go 熔断
limiter.go 限流器
logger.go 日志
recover.go 异常捕获
链路追踪
Gin/Gorm已经加入 RequestId/SpanId
{"level":"info","msg":"sql/Users/houhuiyang/go/src/ourea/internal/domain/service/customer.go:509.984083msSELECt * FROM `upload_img` WHERe `upload_img`.`deleted_at` IS NULL[] 2","requestId":"navigate","spanId":"navigate","time":"2021-11-23 14:19:57"}
{"clientIp":"127.0.0.1","latencyTime":17093224,"level":"info","module":"gin","msg":"","reqMethod":"GET","reqUri":"/api_customer","requestId":"navigate","spanId":"navigate","statusCode":200,"time":"2021-11-23 14:19:57"}
案例
川峡商机 https://www.618.cx
Copyright (c) 2021 ~ 2022 Ourea Go framework By houhuiyang@2021-11-23
cors.go 跨域 hystrix.go 熔断 limiter.go 限流器 logger.go 日志 recover.go 异常捕获
链路追踪
Gin/Gorm已经加入 RequestId/SpanId
{"level":"info","msg":"sql/Users/houhuiyang/go/src/ourea/internal/domain/service/customer.go:509.984083msSELECt * FROM `upload_img` WHERe `upload_img`.`deleted_at` IS NULL[] 2","requestId":"navigate","spanId":"navigate","time":"2021-11-23 14:19:57"}
{"clientIp":"127.0.0.1","latencyTime":17093224,"level":"info","module":"gin","msg":"","reqMethod":"GET","reqUri":"/api_customer","requestId":"navigate","spanId":"navigate","statusCode":200,"time":"2021-11-23 14:19:57"}
案例
川峡商机 https://www.618.cx
Copyright (c) 2021 ~ 2022 Ourea Go framework By houhuiyang@2021-11-23
川峡商机 https://www.618.cx
Copyright (c) 2021 ~ 2022 Ourea Go framework By houhuiyang@2021-11-23



