Documentation
¶
Index ¶
- Variables
- func AppendProcessor(rpcProcessor IRpcProcessor)
- func GetProcessorType(param interface{}) (RpcProcessorType, IRpcProcessor)
- func ReleaseCall(call *Call)
- func ReleaseRpcRequest(rpcRequest *RpcRequest)
- type AdditionParam
- func (*AdditionParam) Descriptor() ([]byte, []int)
- func (m *AdditionParam) GetAdditionOneof() isAdditionParam_AdditionOneof
- func (m *AdditionParam) GetBParam() []byte
- func (m *AdditionParam) GetSParam() int64
- func (m *AdditionParam) GetStrParam() string
- func (m *AdditionParam) GetUParam() uint64
- func (*AdditionParam) ProtoMessage()
- func (m *AdditionParam) Reset()
- func (m *AdditionParam) String() string
- func (m *AdditionParam) XXX_DiscardUnknown()
- func (m *AdditionParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AdditionParam) XXX_Merge(src proto.Message)
- func (*AdditionParam) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- func (m *AdditionParam) XXX_Size() int
- func (m *AdditionParam) XXX_Unmarshal(b []byte) error
- type AdditionParam_BParam
- type AdditionParam_SParam
- type AdditionParam_StrParam
- type AdditionParam_UParam
- type Call
- type Client
- func (client *Client) AddPending(call *Call)
- func (client *Client) AsyncCall(rpcHandler IRpcHandler, serviceMethod string, callback reflect.Value, ...) error
- func (client *Client) Connect(id int, addr string) error
- func (client *Client) FindPending(seq uint64) *Call
- func (client *Client) GetId() int
- func (client *Client) Go(noReply bool, serviceMethod string, args interface{}, reply interface{}) *Call
- func (client *Client) IsConnected() bool
- func (client *Client) NewClientAgent(conn *network.TCPConn) network.Agent
- func (client *Client) OnClose()
- func (client *Client) RawGo(processor IRpcProcessor, noReply bool, serviceMethod string, args []byte, ...) *Call
- func (client *Client) RemovePending(seq uint64) *Call
- func (client *Client) ResetPending()
- func (client *Client) Run()
- type FuncRpcClient
- type FuncRpcServer
- type IRawAdditionParam
- type IRawInputArgs
- type IRpcHandler
- type IRpcProcessor
- type IRpcRequestData
- type IRpcResponseData
- type JsonProcessor
- func (jsonProcessor *JsonProcessor) GetProcessorType() RpcProcessorType
- func (jsonProcessor *JsonProcessor) IsParse(param interface{}) bool
- func (jsonProcessor *JsonProcessor) MakeRpcRequest(seq uint64, serviceMethod string, noReply bool, inParam []byte, ...) IRpcRequestData
- func (jsonProcessor *JsonProcessor) MakeRpcResponse(seq uint64, err RpcError, reply []byte) IRpcResponseData
- func (jsonProcessor *JsonProcessor) Marshal(v interface{}) ([]byte, error)
- func (jsonProcessor *JsonProcessor) ReleaseRpcRequest(rpcRequestData IRpcRequestData)
- func (jsonProcessor *JsonProcessor) ReleaseRpcResponse(rpcResponseData IRpcResponseData)
- func (jsonProcessor *JsonProcessor) Unmarshal(data []byte, v interface{}) error
- type JsonRpcRequestData
- func (jsonRpcRequestData *JsonRpcRequestData) GetAdditionParams() IRawAdditionParam
- func (jsonRpcRequestData *JsonRpcRequestData) GetInParam() []byte
- func (jsonRpcRequestData *JsonRpcRequestData) GetParamValue() interface{}
- func (jsonRpcRequestData *JsonRpcRequestData) GetSeq() uint64
- func (jsonRpcRequestData *JsonRpcRequestData) GetServiceMethod() string
- func (jsonRpcRequestData *JsonRpcRequestData) IsNoReply() bool
- type JsonRpcResponseData
- type PBProcessor
- func (slf *PBProcessor) GetProcessorType() RpcProcessorType
- func (slf *PBProcessor) IsParse(param interface{}) bool
- func (slf *PBProcessor) MakeRpcRequest(seq uint64, serviceMethod string, noReply bool, inParam []byte, ...) IRpcRequestData
- func (slf *PBProcessor) MakeRpcResponse(seq uint64, err RpcError, reply []byte) IRpcResponseData
- func (slf *PBProcessor) Marshal(v interface{}) ([]byte, error)
- func (slf *PBProcessor) ReleaseRpcRequest(rpcRequestData IRpcRequestData)
- func (slf *PBProcessor) ReleaseRpcResponse(rpcResponseData IRpcResponseData)
- func (slf *PBProcessor) Unmarshal(data []byte, msg interface{}) error
- type PBRpcRequestData
- func (*PBRpcRequestData) Descriptor() ([]byte, []int)
- func (m *PBRpcRequestData) GetAdditionParams() IRawAdditionParam
- func (m *PBRpcRequestData) GetAddtionParam() *AdditionParam
- func (m *PBRpcRequestData) GetInParam() []byte
- func (m *PBRpcRequestData) GetNoReply() bool
- func (m *PBRpcRequestData) GetParamValue() interface{}
- func (m *PBRpcRequestData) GetSeq() uint64
- func (m *PBRpcRequestData) GetServiceMethod() string
- func (slf *PBRpcRequestData) IsNoReply() bool
- func (slf *PBRpcRequestData) MakeRequest(seq uint64, serviceMethod string, noReply bool, inParam []byte, ...) *PBRpcRequestData
- func (*PBRpcRequestData) ProtoMessage()
- func (m *PBRpcRequestData) Reset()
- func (m *PBRpcRequestData) String() string
- func (m *PBRpcRequestData) XXX_DiscardUnknown()
- func (m *PBRpcRequestData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PBRpcRequestData) XXX_Merge(src proto.Message)
- func (m *PBRpcRequestData) XXX_Size() int
- func (m *PBRpcRequestData) XXX_Unmarshal(b []byte) error
- type PBRpcResponseData
- func (*PBRpcResponseData) Descriptor() ([]byte, []int)
- func (slf *PBRpcResponseData) GetErr() *RpcError
- func (m *PBRpcResponseData) GetError() string
- func (m *PBRpcResponseData) GetReply() []byte
- func (m *PBRpcResponseData) GetSeq() uint64
- func (slf *PBRpcResponseData) MakeRespone(seq uint64, err RpcError, reply []byte) *PBRpcResponseData
- func (*PBRpcResponseData) ProtoMessage()
- func (m *PBRpcResponseData) Reset()
- func (m *PBRpcResponseData) String() string
- func (m *PBRpcResponseData) XXX_DiscardUnknown()
- func (m *PBRpcResponseData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PBRpcResponseData) XXX_Merge(src proto.Message)
- func (m *PBRpcResponseData) XXX_Size() int
- func (m *PBRpcResponseData) XXX_Unmarshal(b []byte) error
- type RawAdditionParamNull
- type RequestHandler
- type RpcAgent
- func (agent *RpcAgent) Close()
- func (agent *RpcAgent) Destroy()
- func (agent *RpcAgent) LocalAddr() net.Addr
- func (agent *RpcAgent) OnClose()
- func (agent *RpcAgent) OnDestroy()
- func (agent *RpcAgent) RemoteAddr() net.Addr
- func (agent *RpcAgent) Run()
- func (agent *RpcAgent) WriteMsg(msg interface{})
- func (agent *RpcAgent) WriteResponse(processor IRpcProcessor, serviceMethod string, seq uint64, reply interface{}, ...)
- type RpcError
- type RpcHandleFinder
- type RpcHandler
- func (handler *RpcHandler) AsyncCall(serviceMethod string, args interface{}, callback interface{}) error
- func (handler *RpcHandler) AsyncCallNode(nodeId int, serviceMethod string, args interface{}, callback interface{}) error
- func (handler *RpcHandler) Call(serviceMethod string, args interface{}, reply interface{}) error
- func (handler *RpcHandler) CallMethod(ServiceMethod string, param interface{}, reply interface{}) error
- func (handler *RpcHandler) CallNode(nodeId int, serviceMethod string, args interface{}, reply interface{}) error
- func (handler *RpcHandler) CastGo(serviceMethod string, args interface{})
- func (handler *RpcHandler) GetName() string
- func (handler *RpcHandler) GetRpcHandler() IRpcHandler
- func (handler *RpcHandler) GetRpcRequestChan() chan *RpcRequest
- func (handler *RpcHandler) GetRpcResponseChan() chan *Call
- func (handler *RpcHandler) Go(serviceMethod string, args interface{}) error
- func (handler *RpcHandler) GoNode(nodeId int, serviceMethod string, args interface{}) error
- func (handler *RpcHandler) HandlerRpcRequest(request *RpcRequest)
- func (handler *RpcHandler) HandlerRpcResponseCB(call *Call)
- func (handler *RpcHandler) InitRpcHandler(rpcHandler IRpcHandler, getClientFun FuncRpcClient, getServerFun FuncRpcServer)
- func (handler *RpcHandler) IsSingleCoroutine() bool
- func (handler *RpcHandler) PushRequest(req *RpcRequest) error
- func (handler *RpcHandler) RawGoNode(rpcProcessorType RpcProcessorType, nodeId int, serviceMethod string, ...) error
- func (handler *RpcHandler) RegisterRpc(rpcHandler IRpcHandler) error
- type RpcMethodInfo
- type RpcProcessorType
- type RpcRequest
- type RpcResponse
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var LittleEndian bool
Functions ¶
func AppendProcessor ¶
func AppendProcessor(rpcProcessor IRpcProcessor)
func GetProcessorType ¶
func GetProcessorType(param interface{}) (RpcProcessorType, IRpcProcessor)
func ReleaseCall ¶
func ReleaseCall(call *Call)
func ReleaseRpcRequest ¶
func ReleaseRpcRequest(rpcRequest *RpcRequest)
Types ¶
type AdditionParam ¶
type AdditionParam struct {
// Types that are valid to be assigned to AdditionOneof:
// *AdditionParam_SParam
// *AdditionParam_UParam
// *AdditionParam_StrParam
// *AdditionParam_BParam
AdditionOneof isAdditionParam_AdditionOneof `protobuf_oneof:"addition_oneof"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*AdditionParam) Descriptor ¶
func (*AdditionParam) Descriptor() ([]byte, []int)
func (*AdditionParam) GetAdditionOneof ¶
func (m *AdditionParam) GetAdditionOneof() isAdditionParam_AdditionOneof
func (*AdditionParam) GetBParam ¶
func (m *AdditionParam) GetBParam() []byte
func (*AdditionParam) GetSParam ¶
func (m *AdditionParam) GetSParam() int64
func (*AdditionParam) GetStrParam ¶
func (m *AdditionParam) GetStrParam() string
func (*AdditionParam) GetUParam ¶
func (m *AdditionParam) GetUParam() uint64
func (*AdditionParam) ProtoMessage ¶
func (*AdditionParam) ProtoMessage()
func (*AdditionParam) Reset ¶
func (m *AdditionParam) Reset()
func (*AdditionParam) String ¶
func (m *AdditionParam) String() string
func (*AdditionParam) XXX_DiscardUnknown ¶
func (m *AdditionParam) XXX_DiscardUnknown()
func (*AdditionParam) XXX_Marshal ¶
func (m *AdditionParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AdditionParam) XXX_Merge ¶
func (m *AdditionParam) XXX_Merge(src proto.Message)
func (*AdditionParam) XXX_OneofFuncs ¶
func (*AdditionParam) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
func (*AdditionParam) XXX_Size ¶
func (m *AdditionParam) XXX_Size() int
func (*AdditionParam) XXX_Unmarshal ¶
func (m *AdditionParam) XXX_Unmarshal(b []byte) error
type AdditionParam_BParam ¶
type AdditionParam_BParam struct {
BParam []byte `protobuf:"bytes,13,opt,name=BParam,oneof"`
}
type AdditionParam_SParam ¶
type AdditionParam_SParam struct {
SParam int64 `protobuf:"varint,10,opt,name=SParam,oneof"`
}
type AdditionParam_StrParam ¶
type AdditionParam_StrParam struct {
StrParam string `protobuf:"bytes,12,opt,name=StrParam,oneof"`
}
type AdditionParam_UParam ¶
type AdditionParam_UParam struct {
UParam uint64 `protobuf:"varint,11,opt,name=UParam,oneof"`
}
type Call ¶
type Call struct {
Seq uint64
ServiceMethod string
Reply interface{}
Response *RpcResponse
Err error
// contains filtered or unexported fields
}
type Client ¶
func (*Client) AddPending ¶
func (*Client) FindPending ¶
func (*Client) IsConnected ¶
func (*Client) NewClientAgent ¶
func (*Client) RemovePending ¶
func (*Client) ResetPending ¶
func (client *Client) ResetPending()
type FuncRpcClient ¶
type FuncRpcServer ¶
type FuncRpcServer func() *Server
type IRawAdditionParam ¶
type IRawAdditionParam interface {
GetParamValue() interface{}
}
type IRawInputArgs ¶
type IRawInputArgs interface {
GetRawData() []byte //获取原始数据
GetAdditionParam() interface{} //获取附加数据
DoGc() //处理完成,回收内存
}
type IRpcHandler ¶
type IRpcHandler interface {
GetName() string
InitRpcHandler(rpcHandler IRpcHandler, getClientFun FuncRpcClient, getServerFun FuncRpcServer)
GetRpcHandler() IRpcHandler
PushRequest(callInfo *RpcRequest) error
HandlerRpcRequest(request *RpcRequest)
HandlerRpcResponseCB(call *Call)
GetRpcRequestChan() chan *RpcRequest
GetRpcResponseChan() chan *Call
CallMethod(ServiceMethod string, param interface{}, reply interface{}) error
AsyncCall(serviceMethod string, args interface{}, callback interface{}) error
Call(serviceMethod string, args interface{}, reply interface{}) error
Go(serviceMethod string, args interface{}) error
AsyncCallNode(nodeId int, serviceMethod string, args interface{}, callback interface{}) error
CallNode(nodeId int, serviceMethod string, args interface{}, reply interface{}) error
GoNode(nodeId int, serviceMethod string, args interface{}) error
RawGoNode(rpcProcessorType RpcProcessorType, nodeId int, serviceMethod string, args IRawInputArgs) error
IsSingleCoroutine() bool
}
type IRpcProcessor ¶
type IRpcProcessor interface {
Marshal(v interface{}) ([]byte, error) //b表示自定义缓冲区,可以填nil,由系统自动分配
Unmarshal(data []byte, v interface{}) error
MakeRpcRequest(seq uint64, serviceMethod string, noReply bool, inParam []byte, additionParam interface{}) IRpcRequestData
MakeRpcResponse(seq uint64, err RpcError, reply []byte) IRpcResponseData
ReleaseRpcRequest(rpcRequestData IRpcRequestData)
ReleaseRpcResponse(rpcRequestData IRpcResponseData)
IsParse(param interface{}) bool //是否可解析
GetProcessorType() RpcProcessorType
}
func GetProcessor ¶
func GetProcessor(processorType uint8) IRpcProcessor
type IRpcRequestData ¶
type IRpcRequestData interface {
GetSeq() uint64
GetServiceMethod() string
GetInParam() []byte
IsNoReply() bool
GetAdditionParams() IRawAdditionParam
}
type IRpcResponseData ¶
type JsonProcessor ¶
type JsonProcessor struct {
}
func (*JsonProcessor) GetProcessorType ¶
func (jsonProcessor *JsonProcessor) GetProcessorType() RpcProcessorType
func (*JsonProcessor) IsParse ¶
func (jsonProcessor *JsonProcessor) IsParse(param interface{}) bool
func (*JsonProcessor) MakeRpcRequest ¶
func (jsonProcessor *JsonProcessor) MakeRpcRequest(seq uint64, serviceMethod string, noReply bool, inParam []byte, additionParam interface{}) IRpcRequestData
func (*JsonProcessor) MakeRpcResponse ¶
func (jsonProcessor *JsonProcessor) MakeRpcResponse(seq uint64, err RpcError, reply []byte) IRpcResponseData
func (*JsonProcessor) Marshal ¶
func (jsonProcessor *JsonProcessor) Marshal(v interface{}) ([]byte, error)
func (*JsonProcessor) ReleaseRpcRequest ¶
func (jsonProcessor *JsonProcessor) ReleaseRpcRequest(rpcRequestData IRpcRequestData)
func (*JsonProcessor) ReleaseRpcResponse ¶
func (jsonProcessor *JsonProcessor) ReleaseRpcResponse(rpcResponseData IRpcResponseData)
func (*JsonProcessor) Unmarshal ¶
func (jsonProcessor *JsonProcessor) Unmarshal(data []byte, v interface{}) error
type JsonRpcRequestData ¶
type JsonRpcRequestData struct {
//packhead
Seq uint64 // sequence number chosen by client
ServiceMethod string // format: "Service.Method"
NoReply bool //是否需要返回
//packbody
InParam []byte
AdditionParam interface{}
}
func (*JsonRpcRequestData) GetAdditionParams ¶
func (jsonRpcRequestData *JsonRpcRequestData) GetAdditionParams() IRawAdditionParam
func (*JsonRpcRequestData) GetInParam ¶
func (jsonRpcRequestData *JsonRpcRequestData) GetInParam() []byte
func (*JsonRpcRequestData) GetParamValue ¶
func (jsonRpcRequestData *JsonRpcRequestData) GetParamValue() interface{}
func (*JsonRpcRequestData) GetSeq ¶
func (jsonRpcRequestData *JsonRpcRequestData) GetSeq() uint64
func (*JsonRpcRequestData) GetServiceMethod ¶
func (jsonRpcRequestData *JsonRpcRequestData) GetServiceMethod() string
func (*JsonRpcRequestData) IsNoReply ¶
func (jsonRpcRequestData *JsonRpcRequestData) IsNoReply() bool
type JsonRpcResponseData ¶
type JsonRpcResponseData struct {
//head
Seq uint64 // sequence number chosen by client
Err string
//returns
Reply []byte
}
func (*JsonRpcResponseData) GetErr ¶
func (jsonRpcResponseData *JsonRpcResponseData) GetErr() *RpcError
func (*JsonRpcResponseData) GetReply ¶
func (jsonRpcResponseData *JsonRpcResponseData) GetReply() []byte
func (*JsonRpcResponseData) GetSeq ¶
func (jsonRpcResponseData *JsonRpcResponseData) GetSeq() uint64
type PBProcessor ¶
type PBProcessor struct {
}
func (*PBProcessor) GetProcessorType ¶
func (slf *PBProcessor) GetProcessorType() RpcProcessorType
func (*PBProcessor) IsParse ¶
func (slf *PBProcessor) IsParse(param interface{}) bool
func (*PBProcessor) MakeRpcRequest ¶
func (slf *PBProcessor) MakeRpcRequest(seq uint64, serviceMethod string, noReply bool, inParam []byte, inAdditionParam interface{}) IRpcRequestData
func (*PBProcessor) MakeRpcResponse ¶
func (slf *PBProcessor) MakeRpcResponse(seq uint64, err RpcError, reply []byte) IRpcResponseData
func (*PBProcessor) Marshal ¶
func (slf *PBProcessor) Marshal(v interface{}) ([]byte, error)
func (*PBProcessor) ReleaseRpcRequest ¶
func (slf *PBProcessor) ReleaseRpcRequest(rpcRequestData IRpcRequestData)
func (*PBProcessor) ReleaseRpcResponse ¶
func (slf *PBProcessor) ReleaseRpcResponse(rpcResponseData IRpcResponseData)
func (*PBProcessor) Unmarshal ¶
func (slf *PBProcessor) Unmarshal(data []byte, msg interface{}) error
type PBRpcRequestData ¶
type PBRpcRequestData struct {
Seq *uint64 `protobuf:"varint,1,opt,name=Seq" json:"Seq,omitempty"`
ServiceMethod *string `protobuf:"bytes,2,opt,name=ServiceMethod" json:"ServiceMethod,omitempty"`
NoReply *bool `protobuf:"varint,3,opt,name=NoReply" json:"NoReply,omitempty"`
InParam []byte `protobuf:"bytes,4,opt,name=InParam" json:"InParam,omitempty"`
AddtionParam *AdditionParam `protobuf:"bytes,5,opt,name=addtionParam" json:"addtionParam,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*PBRpcRequestData) Descriptor ¶
func (*PBRpcRequestData) Descriptor() ([]byte, []int)
func (*PBRpcRequestData) GetAdditionParams ¶
func (m *PBRpcRequestData) GetAdditionParams() IRawAdditionParam
func (*PBRpcRequestData) GetAddtionParam ¶
func (m *PBRpcRequestData) GetAddtionParam() *AdditionParam
func (*PBRpcRequestData) GetInParam ¶
func (m *PBRpcRequestData) GetInParam() []byte
func (*PBRpcRequestData) GetNoReply ¶
func (m *PBRpcRequestData) GetNoReply() bool
func (*PBRpcRequestData) GetParamValue ¶
func (m *PBRpcRequestData) GetParamValue() interface{}
func (*PBRpcRequestData) GetSeq ¶
func (m *PBRpcRequestData) GetSeq() uint64
func (*PBRpcRequestData) GetServiceMethod ¶
func (m *PBRpcRequestData) GetServiceMethod() string
func (*PBRpcRequestData) IsNoReply ¶
func (slf *PBRpcRequestData) IsNoReply() bool
func (*PBRpcRequestData) MakeRequest ¶
func (slf *PBRpcRequestData) MakeRequest(seq uint64, serviceMethod string, noReply bool, inParam []byte, inAdditionParam interface{}) *PBRpcRequestData
func (*PBRpcRequestData) ProtoMessage ¶
func (*PBRpcRequestData) ProtoMessage()
func (*PBRpcRequestData) Reset ¶
func (m *PBRpcRequestData) Reset()
func (*PBRpcRequestData) String ¶
func (m *PBRpcRequestData) String() string
func (*PBRpcRequestData) XXX_DiscardUnknown ¶
func (m *PBRpcRequestData) XXX_DiscardUnknown()
func (*PBRpcRequestData) XXX_Marshal ¶
func (m *PBRpcRequestData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PBRpcRequestData) XXX_Merge ¶
func (m *PBRpcRequestData) XXX_Merge(src proto.Message)
func (*PBRpcRequestData) XXX_Size ¶
func (m *PBRpcRequestData) XXX_Size() int
func (*PBRpcRequestData) XXX_Unmarshal ¶
func (m *PBRpcRequestData) XXX_Unmarshal(b []byte) error
type PBRpcResponseData ¶
type PBRpcResponseData struct {
Seq *uint64 `protobuf:"varint,1,opt,name=Seq" json:"Seq,omitempty"`
Error *string `protobuf:"bytes,2,opt,name=Error" json:"Error,omitempty"`
Reply []byte `protobuf:"bytes,3,opt,name=Reply" json:"Reply,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*PBRpcResponseData) Descriptor ¶
func (*PBRpcResponseData) Descriptor() ([]byte, []int)
func (*PBRpcResponseData) GetErr ¶
func (slf *PBRpcResponseData) GetErr() *RpcError
func (*PBRpcResponseData) GetError ¶
func (m *PBRpcResponseData) GetError() string
func (*PBRpcResponseData) GetReply ¶
func (m *PBRpcResponseData) GetReply() []byte
func (*PBRpcResponseData) GetSeq ¶
func (m *PBRpcResponseData) GetSeq() uint64
func (*PBRpcResponseData) MakeRespone ¶
func (slf *PBRpcResponseData) MakeRespone(seq uint64, err RpcError, reply []byte) *PBRpcResponseData
func (*PBRpcResponseData) ProtoMessage ¶
func (*PBRpcResponseData) ProtoMessage()
func (*PBRpcResponseData) Reset ¶
func (m *PBRpcResponseData) Reset()
func (*PBRpcResponseData) String ¶
func (m *PBRpcResponseData) String() string
func (*PBRpcResponseData) XXX_DiscardUnknown ¶
func (m *PBRpcResponseData) XXX_DiscardUnknown()
func (*PBRpcResponseData) XXX_Marshal ¶
func (m *PBRpcResponseData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PBRpcResponseData) XXX_Merge ¶
func (m *PBRpcResponseData) XXX_Merge(src proto.Message)
func (*PBRpcResponseData) XXX_Size ¶
func (m *PBRpcResponseData) XXX_Size() int
func (*PBRpcResponseData) XXX_Unmarshal ¶
func (m *PBRpcResponseData) XXX_Unmarshal(b []byte) error
type RawAdditionParamNull ¶
type RawAdditionParamNull struct {
}
func (*RawAdditionParamNull) GetParamValue ¶
func (slf *RawAdditionParamNull) GetParamValue() interface{}
type RequestHandler ¶
type RequestHandler func(Returns interface{}, Err RpcError)
type RpcAgent ¶
type RpcAgent struct {
// contains filtered or unexported fields
}
func (*RpcAgent) RemoteAddr ¶
func (*RpcAgent) WriteResponse ¶
func (agent *RpcAgent) WriteResponse(processor IRpcProcessor, serviceMethod string, seq uint64, reply interface{}, err RpcError)
type RpcHandleFinder ¶
type RpcHandleFinder interface {
FindRpcHandler(serviceMethod string) IRpcHandler
}
type RpcHandler ¶
type RpcHandler struct {
// contains filtered or unexported fields
}
func (*RpcHandler) AsyncCall ¶
func (handler *RpcHandler) AsyncCall(serviceMethod string, args interface{}, callback interface{}) error
func (*RpcHandler) AsyncCallNode ¶
func (handler *RpcHandler) AsyncCallNode(nodeId int, serviceMethod string, args interface{}, callback interface{}) error
func (*RpcHandler) Call ¶
func (handler *RpcHandler) Call(serviceMethod string, args interface{}, reply interface{}) error
func (*RpcHandler) CallMethod ¶
func (handler *RpcHandler) CallMethod(ServiceMethod string, param interface{}, reply interface{}) error
func (*RpcHandler) CallNode ¶
func (handler *RpcHandler) CallNode(nodeId int, serviceMethod string, args interface{}, reply interface{}) error
func (*RpcHandler) CastGo ¶
func (handler *RpcHandler) CastGo(serviceMethod string, args interface{})
func (*RpcHandler) GetName ¶
func (handler *RpcHandler) GetName() string
func (*RpcHandler) GetRpcHandler ¶
func (handler *RpcHandler) GetRpcHandler() IRpcHandler
func (*RpcHandler) GetRpcRequestChan ¶
func (handler *RpcHandler) GetRpcRequestChan() chan *RpcRequest
func (*RpcHandler) GetRpcResponseChan ¶
func (handler *RpcHandler) GetRpcResponseChan() chan *Call
func (*RpcHandler) Go ¶
func (handler *RpcHandler) Go(serviceMethod string, args interface{}) error
func (*RpcHandler) GoNode ¶
func (handler *RpcHandler) GoNode(nodeId int, serviceMethod string, args interface{}) error
func (*RpcHandler) HandlerRpcRequest ¶
func (handler *RpcHandler) HandlerRpcRequest(request *RpcRequest)
func (*RpcHandler) HandlerRpcResponseCB ¶
func (handler *RpcHandler) HandlerRpcResponseCB(call *Call)
func (*RpcHandler) InitRpcHandler ¶
func (handler *RpcHandler) InitRpcHandler(rpcHandler IRpcHandler, getClientFun FuncRpcClient, getServerFun FuncRpcServer)
func (*RpcHandler) IsSingleCoroutine ¶
func (handler *RpcHandler) IsSingleCoroutine() bool
func (*RpcHandler) PushRequest ¶
func (handler *RpcHandler) PushRequest(req *RpcRequest) error
func (*RpcHandler) RawGoNode ¶
func (handler *RpcHandler) RawGoNode(rpcProcessorType RpcProcessorType, nodeId int, serviceMethod string, args IRawInputArgs) error
func (*RpcHandler) RegisterRpc ¶
func (handler *RpcHandler) RegisterRpc(rpcHandler IRpcHandler) error
type RpcMethodInfo ¶
type RpcMethodInfo struct {
// contains filtered or unexported fields
}
type RpcProcessorType ¶
type RpcProcessorType uint8
const ( RpcProcessorJson RpcProcessorType = 0 RpcProcessorPb RpcProcessorType = 1 )
type RpcRequest ¶
type RpcRequest struct {
RpcRequestData IRpcRequestData
// contains filtered or unexported fields
}
func MakeRpcRequest ¶
func MakeRpcRequest() *RpcRequest
func (*RpcRequest) Clear ¶
func (slf *RpcRequest) Clear() *RpcRequest
type RpcResponse ¶
type RpcResponse struct {
RpcResponseData IRpcResponseData
}
func (*RpcResponse) Clear ¶
func (rpcResponse *RpcResponse) Clear() *RpcResponse
Click to show internal directories.
Click to hide internal directories.