mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
新增RawGoNode与RawCastGo接口,支持RPC附带原始数据
This commit is contained in:
14
rpc/rpc.go
14
rpc/rpc.go
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user