Skip to content

Commit d67ad41

Browse files
committed
feat: rpc server is ready
1 parent a0a9b79 commit d67ad41

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2793
-140
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,9 @@
1919

2020
# Go workspace file
2121
go.work
22+
23+
# log file
24+
*.log
25+
26+
# idea
27+
.idea

.golangci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ linters:
2222
issues:
2323
exclude-use-default: false
2424
max-issues-per-linter: 0
25-
max-same-issues: 0
25+
max-same-issues: 0
26+

README.md

Lines changed: 57 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,75 @@ Microservice framework implemented based on Golang.
2424
## Framework
2525
```shell
2626
├─api 存放与外部交互的接口及 proto 文件
27+
│ ├─metadata
2728
│ └─user
2829
│ └─v1
2930
├─app 具体服务相关的实现
31+
│ ├─shop
32+
│ │ └─admin
33+
│ │ ├─config
34+
│ │ └─controller
3035
│ ├─pkg 服务共通的包
31-
│ │ └─code 服务的错误码
36+
│ │ ├─code 服务的错误码
37+
│ │ ├─options
38+
│ │ └─translator
39+
│ │ └─gin
3240
│ └─user 举例 user 服务
41+
│ ├─client
3342
│ └─srv
3443
│ ├─config 服务的配置项,Log error 等子服务的相关逻辑全部注册到配置中
35-
│ ├─controller 表示层
44+
│ ├─controller 表示层
3645
│ │ └─user
3746
│ ├─data 数据访问层:数据库,缓存,消息队列等,无业务逻辑
3847
│ │ └─v1
39-
│ │ ├─db
40-
│ │ └─mock
48+
│ │ ├─db 数据库相关的操作
49+
│ │ └─mock 数据库的 mock 用于测试
4150
│ └─service 业务逻辑层
42-
│ └─v1
51+
│ │ └─v1
52+
│ ├─app.go user 服务生成逻辑
53+
│ └─rpc.go user 模块的 rpc 服务 初始化逻辑
4354
├─cmd 服务启动入口
55+
│ ├─admin
4456
│ └─user 启动示例 user 服务
4557
├─configs 配置文件
46-
├─gmicro
58+
│ ├─admin
59+
│ └─user
60+
├─gmicro 微服务相关包
4761
│ ├─app 服务启动相关的结构体
48-
│ └─registry 服务实例注册信息相关结构体
62+
│ │ └─app.go 这个 app 是 GRPC,服务名称,注册中心等的集合
63+
│ ├─code
64+
│ ├─core
65+
│ │ ├─metric
66+
│ │ └─trace
67+
│ ├─registry
68+
│ │ └─consul 服务注册中心相关逻辑,参考 kratos
69+
│ └─server
70+
│ ├─restserver
71+
│ │ ├─middlewares
72+
│ │ │ └─auth
73+
│ │ ├─pprof
74+
│ │ └─validation
75+
│ └─rpcserver
76+
│ ├─clientinterceptors
77+
│ ├─resolver
78+
│ │ ├─direct
79+
│ │ └─discovery
80+
│ ├─selector
81+
│ │ ├─node
82+
│ │ │ ├─direct
83+
│ │ │ └─ewma
84+
│ │ ├─p2c
85+
│ │ ├─random
86+
│ │ └─wrr
87+
│ └─serverinterceptors
4988
├─pkg
50-
│ ├─app
89+
│ ├─app 包括的项目的启动服务,配置文件的读取,命令行工具,以及其他选项
90+
│ │ ├─app.go 服务启动:命令行工具,日志,错误包,配置等
91+
│ │ ├─config.go 读取配置文件
92+
│ │ ├─flag.go 命令行工具
93+
│ │ ├─cmd.go 服务启动命令
94+
│ │ ├─options.go 服务启动选项
95+
│ │ └─help.go 帮助信息
5196
│ ├─common 共通相关的包
5297
│ │ ├─auth
5398
│ │ ├─cli
@@ -64,7 +109,7 @@ Microservice framework implemented based on Golang.
64109
│ │ ├─time
65110
│ │ ├─tools
66111
│ │ ├─util
67-
│ │ │ ├─clock 时间相关的工具
112+
│ │ │ ├─clock 时间相关的工具
68113
│ │ │ ├─fileutil
69114
│ │ │ ├─homedir
70115
│ │ │ ├─idutil
@@ -83,9 +128,10 @@ Microservice framework implemented based on Golang.
83128
│ │ └─version
84129
│ │ └─verflag
85130
│ ├─errors 基础的 error 包 可以单独使用
131+
│ ├─host
86132
│ └─log 基础的 error 包 可以单独使用
87-
└─tools 工具包
88-
└─codegen errorCode 代码生成工具
133+
└─tools
134+
└─codegen errorCode 代码生成工具
89135
```
90136

91137

0 commit comments

Comments
 (0)