initial import

This commit is contained in:
kevin
2020-07-26 17:09:05 +08:00
commit 7e3a369a8f
647 changed files with 54754 additions and 0 deletions

13
doc/rpc.md Normal file
View File

@@ -0,0 +1,13 @@
# rpc设计规范
* 目录结构
* service/remote目录下按照服务所属模块存放比如用户的profile接口目录如下
`service/remote/user/profile.proto`
* 生成的profile.pb.go也放在该目录下并且profile.proto文件里要加上`package user;`
* 错误处理
* 需要使用status.Error(code, desc)来定义返回的错误
* code是codes.Code类型尽可能使用grpc已经定义好的code
* codes.DeadlineExceeded, codes.Internal, codes.Unavailable, codes.DataLoss错误会被自动熔断