新增RawGoNode与RawCastGo接口,支持RPC附带原始数据

This commit is contained in:
boyce
2020-09-02 13:39:18 +08:00
parent 663cb18ce0
commit 0185fe350f
9 changed files with 462 additions and 57 deletions

View File

@@ -9,8 +9,10 @@ import (
type RpcRequest struct {
RpcRequestData IRpcRequestData
bLocalRequest bool
localReply interface{}
localParam interface{} //本地调用的参数列表
localRawParam []byte
requestHandle RequestHandler
callback *reflect.Value
}
@@ -33,11 +35,16 @@ func (slf *RpcResponse) Clear() *RpcResponse{
return slf
}
type IRawAdditionParam interface {
GetParamValue() interface{}
}
type IRpcRequestData interface {
GetSeq() uint64
GetServiceMethod() string
GetInParam() []byte
IsNoReply() bool
GetAdditionParams() IRawAdditionParam
}
type IRpcResponseData interface {
@@ -48,6 +55,13 @@ type IRpcResponseData interface {
type RequestHandler func(Returns interface{},Err *RpcError)
type RawAdditionParamNull struct {
}
func (slf *RawAdditionParamNull) GetParamValue() interface{}{
return nil
}
type Call struct {
Seq uint64