gorilla / rpc

Package gorilla/rpc is a golang foundation for RPC over HTTP services.
https://gorilla.github.io
BSD 3-Clause "New" or "Revised" License
590 stars 179 forks source link

从gorilla/rpc/v2中独立,新增RegisterMethod, RegisterAlias #89

Closed wbylovesun closed 2 years ago

wbylovesun commented 2 years ago

保留版权声明,协议与gorilla/rpc一致

Fixes #

Summary of Changes

  1. 增加RegisterMethod,支持完整路径定义method
  2. 增加RegisterAlias,支持多路径映射同一方法
  3. 在注册方法时,取消serviceMap.services, service.methods,变为serviceMap.methods,在serviceMap.methods中存储完整路径
  4. 变更路径形式,将Service.Method变更为Service/method
  5. 按jsonrpc规范,修订Error/Reply,当成功时error不输出,当失败时reply不输出
  6. 修订测试用例
  7. 将testapp从json中剥离,形成独立的测试应用目录
  8. 将WriteError从server.go文件中独立成writer.go
  9. 将codec接口定义从server.go文件中独立成codec.go