Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
enhancement for #1
设计方案
首先,根据我看代码的过程,在咱们这项目中的RPC调用依赖于 internal/rpc 包中所定义的mdsClinet, 这个mdsClient 的初始化以及方法调用都依赖于curve-go-rpc 这个包,我们这个项目的目的是去除这个包的依赖,并且改为HTTP的通信方式,我做了如下几步操作
1: 同样在internal 下构建http包,之后所有上层关于RPC的方法调用全部都是用这个包中重新开发的方法调用目录如下
http
——badeHttp
——common
——curvebs
该模块仿照curve-go-rpc的结构构建而成,从而提供之前rpc包中的所有http版本方法
2: 关于HTTP的调用,在baseHTTP/http中定义,里面最重要的是定义了sendHTTP方法(原来是sendRPC),之后所有方法与Cluster的通信均通过其通信
3: 改动最大的部分,是将namespace中和topology中的所用方法都改成了HTTP版本例如ListPhysicalPool方法改版为
ListPhysicalPool_http。