Documentation ¶
Index ¶
- Variables
- func AppendProcessor(rpcProcessor IRpcProcessor)
- func GetProcessorType(param interface{}) (RpcProcessorType, IRpcProcessor)
- func ReleaseCall(call *Call)
- func ReleaseRpcRequest(rpcRequest *RpcRequest)
- 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) Close(waitDone bool)
- func (client *Client) Connect(id int, addr string, maxRpcParamLen uint32) error
- func (client *Client) FindPending(seq uint64) *Call
- func (client *Client) GetClientSeq() uint32
- 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, rpcMethodId uint32, ...) *Call
- func (client *Client) RemovePending(seq uint64) *Call
- func (client *Client) ResetPending()
- func (client *Client) Run()
- type Empty
- func (*Empty) Descriptor() ([]byte, []int)
- func (m *Empty) Marshal() (dAtA []byte, err error)
- func (m *Empty) MarshalTo(dAtA []byte) (int, error)
- func (m *Empty) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Empty) ProtoMessage()
- func (m *Empty) Reset()
- func (m *Empty) Size() (n int)
- func (m *Empty) String() string
- func (m *Empty) Unmarshal(dAtA []byte) error
- func (m *Empty) XXX_DiscardUnknown()
- func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Empty) XXX_Merge(src proto.Message)
- func (m *Empty) XXX_Size() int
- func (m *Empty) XXX_Unmarshal(b []byte) error
- type FuncRpcClient
- type FuncRpcServer
- type GoGoPBProcessor
- func (slf *GoGoPBProcessor) GetProcessorType() RpcProcessorType
- func (slf *GoGoPBProcessor) IsParse(param interface{}) bool
- func (slf *GoGoPBProcessor) MakeRpcRequest(seq uint64, rpcMethodId uint32, serviceMethod string, noReply bool, ...) IRpcRequestData
- func (slf *GoGoPBProcessor) MakeRpcResponse(seq uint64, err RpcError, reply []byte) IRpcResponseData
- func (slf *GoGoPBProcessor) Marshal(v interface{}) ([]byte, error)
- func (slf *GoGoPBProcessor) ReleaseRpcRequest(rpcRequestData IRpcRequestData)
- func (slf *GoGoPBProcessor) ReleaseRpcResponse(rpcResponseData IRpcResponseData)
- func (slf *GoGoPBProcessor) Unmarshal(data []byte, msg interface{}) error
- type GoGoPBRpcRequestData
- func (*GoGoPBRpcRequestData) Descriptor() ([]byte, []int)
- func (m *GoGoPBRpcRequestData) GetInParam() []byte
- func (m *GoGoPBRpcRequestData) GetNoReply() bool
- func (m *GoGoPBRpcRequestData) GetRpcMethodId() uint32
- func (m *GoGoPBRpcRequestData) GetSeq() uint64
- func (m *GoGoPBRpcRequestData) GetServiceMethod() string
- func (slf *GoGoPBRpcRequestData) IsNoReply() bool
- func (slf *GoGoPBRpcRequestData) MakeRequest(seq uint64, rpcMethodId uint32, serviceMethod string, noReply bool, ...) *GoGoPBRpcRequestData
- func (m *GoGoPBRpcRequestData) Marshal() (dAtA []byte, err error)
- func (m *GoGoPBRpcRequestData) MarshalTo(dAtA []byte) (int, error)
- func (m *GoGoPBRpcRequestData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GoGoPBRpcRequestData) ProtoMessage()
- func (m *GoGoPBRpcRequestData) Reset()
- func (m *GoGoPBRpcRequestData) Size() (n int)
- func (m *GoGoPBRpcRequestData) String() string
- func (m *GoGoPBRpcRequestData) Unmarshal(dAtA []byte) error
- func (m *GoGoPBRpcRequestData) XXX_DiscardUnknown()
- func (m *GoGoPBRpcRequestData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GoGoPBRpcRequestData) XXX_Merge(src proto.Message)
- func (m *GoGoPBRpcRequestData) XXX_Size() int
- func (m *GoGoPBRpcRequestData) XXX_Unmarshal(b []byte) error
- type GoGoPBRpcResponseData
- func (*GoGoPBRpcResponseData) Descriptor() ([]byte, []int)
- func (slf *GoGoPBRpcResponseData) GetErr() *RpcError
- func (m *GoGoPBRpcResponseData) GetError() string
- func (m *GoGoPBRpcResponseData) GetReply() []byte
- func (m *GoGoPBRpcResponseData) GetSeq() uint64
- func (slf *GoGoPBRpcResponseData) MakeRespone(seq uint64, err RpcError, reply []byte) *GoGoPBRpcResponseData
- func (m *GoGoPBRpcResponseData) Marshal() (dAtA []byte, err error)
- func (m *GoGoPBRpcResponseData) MarshalTo(dAtA []byte) (int, error)
- func (m *GoGoPBRpcResponseData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GoGoPBRpcResponseData) ProtoMessage()
- func (m *GoGoPBRpcResponseData) Reset()
- func (m *GoGoPBRpcResponseData) Size() (n int)
- func (m *GoGoPBRpcResponseData) String() string
- func (m *GoGoPBRpcResponseData) Unmarshal(dAtA []byte) error
- func (m *GoGoPBRpcResponseData) XXX_DiscardUnknown()
- func (m *GoGoPBRpcResponseData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GoGoPBRpcResponseData) XXX_Merge(src proto.Message)
- func (m *GoGoPBRpcResponseData) XXX_Size() int
- func (m *GoGoPBRpcResponseData) XXX_Unmarshal(b []byte) error
- type IRawInputArgs
- type IRpcHandler
- type IRpcHandlerChannel
- type IRpcListener
- 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, rpcMethodId uint32, serviceMethod string, noReply bool, ...) 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) GetInParam() []byte
- func (jsonRpcRequestData *JsonRpcRequestData) GetRpcMethodId() uint32
- func (jsonRpcRequestData *JsonRpcRequestData) GetSeq() uint64
- func (jsonRpcRequestData *JsonRpcRequestData) GetServiceMethod() string
- func (jsonRpcRequestData *JsonRpcRequestData) IsNoReply() bool
- type JsonRpcResponseData
- type NodeInfo
- func (*NodeInfo) Descriptor() ([]byte, []int)
- func (m *NodeInfo) GetListenAddr() string
- func (m *NodeInfo) GetMaxRpcParamLen() uint32
- func (m *NodeInfo) GetNodeId() int32
- func (m *NodeInfo) GetNodeName() string
- func (m *NodeInfo) GetPrivate() bool
- func (m *NodeInfo) GetPublicServiceList() []string
- func (m *NodeInfo) Marshal() (dAtA []byte, err error)
- func (m *NodeInfo) MarshalTo(dAtA []byte) (int, error)
- func (m *NodeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*NodeInfo) ProtoMessage()
- func (m *NodeInfo) Reset()
- func (m *NodeInfo) Size() (n int)
- func (m *NodeInfo) String() string
- func (m *NodeInfo) Unmarshal(dAtA []byte) error
- func (m *NodeInfo) XXX_DiscardUnknown()
- func (m *NodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *NodeInfo) XXX_Merge(src proto.Message)
- func (m *NodeInfo) XXX_Size() int
- func (m *NodeInfo) XXX_Unmarshal(b []byte) error
- type RawRpcCallBack
- type RequestHandler
- type Responder
- 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{}) error
- func (handler *RpcHandler) GetName() string
- func (handler *RpcHandler) GetRpcHandler() IRpcHandler
- 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) RawGoNode(rpcProcessorType RpcProcessorType, nodeId int, rpcMethodId uint32, ...) error
- func (handler *RpcHandler) RegRawRpc(rpcMethodId uint32, rawRpcCB RawRpcCallBack)
- func (handler *RpcHandler) RegisterRpc(rpcHandler IRpcHandler) error
- func (handler *RpcHandler) UnmarshalInParam(rpcProcessor IRpcProcessor, serviceMethod string, rawRpcMethodId uint32, ...) (interface{}, error)
- type RpcMethodInfo
- type RpcProcessorType
- type RpcRequest
- type RpcResponse
- type Server
- type ServiceDiscoverReq
- func (*ServiceDiscoverReq) Descriptor() ([]byte, []int)
- func (m *ServiceDiscoverReq) GetNodeInfo() *NodeInfo
- func (m *ServiceDiscoverReq) Marshal() (dAtA []byte, err error)
- func (m *ServiceDiscoverReq) MarshalTo(dAtA []byte) (int, error)
- func (m *ServiceDiscoverReq) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ServiceDiscoverReq) ProtoMessage()
- func (m *ServiceDiscoverReq) Reset()
- func (m *ServiceDiscoverReq) Size() (n int)
- func (m *ServiceDiscoverReq) String() string
- func (m *ServiceDiscoverReq) Unmarshal(dAtA []byte) error
- func (m *ServiceDiscoverReq) XXX_DiscardUnknown()
- func (m *ServiceDiscoverReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ServiceDiscoverReq) XXX_Merge(src proto.Message)
- func (m *ServiceDiscoverReq) XXX_Size() int
- func (m *ServiceDiscoverReq) XXX_Unmarshal(b []byte) error
- type SubscribeDiscoverNotify
- func (*SubscribeDiscoverNotify) Descriptor() ([]byte, []int)
- func (m *SubscribeDiscoverNotify) GetDelNodeId() int32
- func (m *SubscribeDiscoverNotify) GetIsFull() bool
- func (m *SubscribeDiscoverNotify) GetMasterNodeId() int32
- func (m *SubscribeDiscoverNotify) GetNodeInfo() []*NodeInfo
- func (m *SubscribeDiscoverNotify) Marshal() (dAtA []byte, err error)
- func (m *SubscribeDiscoverNotify) MarshalTo(dAtA []byte) (int, error)
- func (m *SubscribeDiscoverNotify) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SubscribeDiscoverNotify) ProtoMessage()
- func (m *SubscribeDiscoverNotify) Reset()
- func (m *SubscribeDiscoverNotify) Size() (n int)
- func (m *SubscribeDiscoverNotify) String() string
- func (m *SubscribeDiscoverNotify) Unmarshal(dAtA []byte) error
- func (m *SubscribeDiscoverNotify) XXX_DiscardUnknown()
- func (m *SubscribeDiscoverNotify) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SubscribeDiscoverNotify) XXX_Merge(src proto.Message)
- func (m *SubscribeDiscoverNotify) XXX_Size() int
- func (m *SubscribeDiscoverNotify) XXX_Unmarshal(b []byte) error
- type TriggerRpcEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthDynamicdiscover = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowDynamicdiscover = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupDynamicdiscover = fmt.Errorf("proto: unexpected end of group") )
View Source
var ( ErrInvalidLengthGogorpc = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGogorpc = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGogorpc = fmt.Errorf("proto: unexpected end of group") )
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 Call ¶
type Call struct { Seq uint64 ServiceMethod string Reply interface{} Response *RpcResponse Err error // contains filtered or unexported fields }
type Client ¶
type Client struct { network.TCPClient TriggerRpcEvent // contains filtered or unexported fields }
func (*Client) AddPending ¶
func (*Client) FindPending ¶
func (*Client) GetClientSeq ¶
func (*Client) IsConnected ¶
func (*Client) NewClientAgent ¶
func (*Client) RemovePending ¶
func (*Client) ResetPending ¶
func (client *Client) ResetPending()
type Empty ¶
type Empty struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Master->Client
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) XXX_DiscardUnknown ¶
func (m *Empty) XXX_DiscardUnknown()
func (*Empty) XXX_Marshal ¶
func (*Empty) XXX_Unmarshal ¶
type FuncRpcClient ¶
type FuncRpcServer ¶
type FuncRpcServer func() *Server
type GoGoPBProcessor ¶
type GoGoPBProcessor struct { }
func (*GoGoPBProcessor) GetProcessorType ¶
func (slf *GoGoPBProcessor) GetProcessorType() RpcProcessorType
func (*GoGoPBProcessor) IsParse ¶
func (slf *GoGoPBProcessor) IsParse(param interface{}) bool
func (*GoGoPBProcessor) MakeRpcRequest ¶
func (slf *GoGoPBProcessor) MakeRpcRequest(seq uint64, rpcMethodId uint32, serviceMethod string, noReply bool, inParam []byte) IRpcRequestData
func (*GoGoPBProcessor) MakeRpcResponse ¶
func (slf *GoGoPBProcessor) MakeRpcResponse(seq uint64, err RpcError, reply []byte) IRpcResponseData
func (*GoGoPBProcessor) Marshal ¶
func (slf *GoGoPBProcessor) Marshal(v interface{}) ([]byte, error)
func (*GoGoPBProcessor) ReleaseRpcRequest ¶
func (slf *GoGoPBProcessor) ReleaseRpcRequest(rpcRequestData IRpcRequestData)
func (*GoGoPBProcessor) ReleaseRpcResponse ¶
func (slf *GoGoPBProcessor) ReleaseRpcResponse(rpcResponseData IRpcResponseData)
func (*GoGoPBProcessor) Unmarshal ¶
func (slf *GoGoPBProcessor) Unmarshal(data []byte, msg interface{}) error
type GoGoPBRpcRequestData ¶
type GoGoPBRpcRequestData struct { Seq uint64 `protobuf:"varint,1,opt,name=Seq,proto3" json:"Seq,omitempty"` RpcMethodId uint32 `protobuf:"varint,2,opt,name=RpcMethodId,proto3" json:"RpcMethodId,omitempty"` ServiceMethod string `protobuf:"bytes,3,opt,name=ServiceMethod,proto3" json:"ServiceMethod,omitempty"` NoReply bool `protobuf:"varint,4,opt,name=NoReply,proto3" json:"NoReply,omitempty"` InParam []byte `protobuf:"bytes,5,opt,name=InParam,proto3" json:"InParam,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*GoGoPBRpcRequestData) Descriptor ¶
func (*GoGoPBRpcRequestData) Descriptor() ([]byte, []int)
func (*GoGoPBRpcRequestData) GetInParam ¶
func (m *GoGoPBRpcRequestData) GetInParam() []byte
func (*GoGoPBRpcRequestData) GetNoReply ¶
func (m *GoGoPBRpcRequestData) GetNoReply() bool
func (*GoGoPBRpcRequestData) GetRpcMethodId ¶
func (m *GoGoPBRpcRequestData) GetRpcMethodId() uint32
func (*GoGoPBRpcRequestData) GetSeq ¶
func (m *GoGoPBRpcRequestData) GetSeq() uint64
func (*GoGoPBRpcRequestData) GetServiceMethod ¶
func (m *GoGoPBRpcRequestData) GetServiceMethod() string
func (*GoGoPBRpcRequestData) IsNoReply ¶
func (slf *GoGoPBRpcRequestData) IsNoReply() bool
func (*GoGoPBRpcRequestData) MakeRequest ¶
func (slf *GoGoPBRpcRequestData) MakeRequest(seq uint64, rpcMethodId uint32, serviceMethod string, noReply bool, inParam []byte) *GoGoPBRpcRequestData
func (*GoGoPBRpcRequestData) Marshal ¶
func (m *GoGoPBRpcRequestData) Marshal() (dAtA []byte, err error)
func (*GoGoPBRpcRequestData) MarshalTo ¶
func (m *GoGoPBRpcRequestData) MarshalTo(dAtA []byte) (int, error)
func (*GoGoPBRpcRequestData) MarshalToSizedBuffer ¶
func (m *GoGoPBRpcRequestData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GoGoPBRpcRequestData) ProtoMessage ¶
func (*GoGoPBRpcRequestData) ProtoMessage()
func (*GoGoPBRpcRequestData) Reset ¶
func (m *GoGoPBRpcRequestData) Reset()
func (*GoGoPBRpcRequestData) Size ¶
func (m *GoGoPBRpcRequestData) Size() (n int)
func (*GoGoPBRpcRequestData) String ¶
func (m *GoGoPBRpcRequestData) String() string
func (*GoGoPBRpcRequestData) Unmarshal ¶
func (m *GoGoPBRpcRequestData) Unmarshal(dAtA []byte) error
func (*GoGoPBRpcRequestData) XXX_DiscardUnknown ¶
func (m *GoGoPBRpcRequestData) XXX_DiscardUnknown()
func (*GoGoPBRpcRequestData) XXX_Marshal ¶
func (m *GoGoPBRpcRequestData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GoGoPBRpcRequestData) XXX_Merge ¶
func (m *GoGoPBRpcRequestData) XXX_Merge(src proto.Message)
func (*GoGoPBRpcRequestData) XXX_Size ¶
func (m *GoGoPBRpcRequestData) XXX_Size() int
func (*GoGoPBRpcRequestData) XXX_Unmarshal ¶
func (m *GoGoPBRpcRequestData) XXX_Unmarshal(b []byte) error
type GoGoPBRpcResponseData ¶
type GoGoPBRpcResponseData struct { Seq uint64 `protobuf:"varint,1,opt,name=Seq,proto3" json:"Seq,omitempty"` Error string `protobuf:"bytes,2,opt,name=Error,proto3" json:"Error,omitempty"` Reply []byte `protobuf:"bytes,3,opt,name=Reply,proto3" json:"Reply,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*GoGoPBRpcResponseData) Descriptor ¶
func (*GoGoPBRpcResponseData) Descriptor() ([]byte, []int)
func (*GoGoPBRpcResponseData) GetErr ¶
func (slf *GoGoPBRpcResponseData) GetErr() *RpcError
func (*GoGoPBRpcResponseData) GetError ¶
func (m *GoGoPBRpcResponseData) GetError() string
func (*GoGoPBRpcResponseData) GetReply ¶
func (m *GoGoPBRpcResponseData) GetReply() []byte
func (*GoGoPBRpcResponseData) GetSeq ¶
func (m *GoGoPBRpcResponseData) GetSeq() uint64
func (*GoGoPBRpcResponseData) MakeRespone ¶
func (slf *GoGoPBRpcResponseData) MakeRespone(seq uint64, err RpcError, reply []byte) *GoGoPBRpcResponseData
func (*GoGoPBRpcResponseData) Marshal ¶
func (m *GoGoPBRpcResponseData) Marshal() (dAtA []byte, err error)
func (*GoGoPBRpcResponseData) MarshalTo ¶
func (m *GoGoPBRpcResponseData) MarshalTo(dAtA []byte) (int, error)
func (*GoGoPBRpcResponseData) MarshalToSizedBuffer ¶
func (m *GoGoPBRpcResponseData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GoGoPBRpcResponseData) ProtoMessage ¶
func (*GoGoPBRpcResponseData) ProtoMessage()
func (*GoGoPBRpcResponseData) Reset ¶
func (m *GoGoPBRpcResponseData) Reset()
func (*GoGoPBRpcResponseData) Size ¶
func (m *GoGoPBRpcResponseData) Size() (n int)
func (*GoGoPBRpcResponseData) String ¶
func (m *GoGoPBRpcResponseData) String() string
func (*GoGoPBRpcResponseData) Unmarshal ¶
func (m *GoGoPBRpcResponseData) Unmarshal(dAtA []byte) error
func (*GoGoPBRpcResponseData) XXX_DiscardUnknown ¶
func (m *GoGoPBRpcResponseData) XXX_DiscardUnknown()
func (*GoGoPBRpcResponseData) XXX_Marshal ¶
func (m *GoGoPBRpcResponseData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GoGoPBRpcResponseData) XXX_Merge ¶
func (m *GoGoPBRpcResponseData) XXX_Merge(src proto.Message)
func (*GoGoPBRpcResponseData) XXX_Size ¶
func (m *GoGoPBRpcResponseData) XXX_Size() int
func (*GoGoPBRpcResponseData) XXX_Unmarshal ¶
func (m *GoGoPBRpcResponseData) XXX_Unmarshal(b []byte) error
type IRawInputArgs ¶
type IRawInputArgs interface { GetRawData() []byte //获取原始数据 DoFree() //处理完成,回收内存 DoEscape() //逃逸,GC自动回收 }
type IRpcHandler ¶
type IRpcHandler interface { IRpcHandlerChannel GetName() string InitRpcHandler(rpcHandler IRpcHandler, getClientFun FuncRpcClient, getServerFun FuncRpcServer, rpcHandlerChannel IRpcHandlerChannel) GetRpcHandler() IRpcHandler HandlerRpcRequest(request *RpcRequest) HandlerRpcResponseCB(call *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, rpcMethodId uint32, serviceName string, rawArgs IRawInputArgs) error CastGo(serviceMethod string, args interface{}) error IsSingleCoroutine() bool UnmarshalInParam(rpcProcessor IRpcProcessor, serviceMethod string, rawRpcMethodId uint32, inParam []byte) (interface{}, error) }
type IRpcHandlerChannel ¶
type IRpcHandlerChannel interface { PushRpcResponse(call *Call) error PushRpcRequest(rpcRequest *RpcRequest) error }
type IRpcListener ¶
type IRpcProcessor ¶
type IRpcProcessor interface { Marshal(v interface{}) ([]byte, error) //b表示自定义缓冲区,可以填nil,由系统自动分配 Unmarshal(data []byte, v interface{}) error MakeRpcRequest(seq uint64, rpcMethodId uint32, serviceMethod string, noReply bool, inParam []byte) 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 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, rpcMethodId uint32, serviceMethod string, noReply bool, inParam []byte) 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 // contains filtered or unexported fields }
func (*JsonRpcRequestData) GetInParam ¶
func (jsonRpcRequestData *JsonRpcRequestData) GetInParam() []byte
func (*JsonRpcRequestData) GetRpcMethodId ¶
func (jsonRpcRequestData *JsonRpcRequestData) GetRpcMethodId() uint32
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 NodeInfo ¶
type NodeInfo struct { NodeId int32 `protobuf:"varint,1,opt,name=NodeId,proto3" json:"NodeId,omitempty"` NodeName string `protobuf:"bytes,2,opt,name=NodeName,proto3" json:"NodeName,omitempty"` ListenAddr string `protobuf:"bytes,3,opt,name=ListenAddr,proto3" json:"ListenAddr,omitempty"` MaxRpcParamLen uint32 `protobuf:"varint,4,opt,name=MaxRpcParamLen,proto3" json:"MaxRpcParamLen,omitempty"` Private bool `protobuf:"varint,5,opt,name=Private,proto3" json:"Private,omitempty"` PublicServiceList []string `protobuf:"bytes,6,rep,name=PublicServiceList,proto3" json:"PublicServiceList,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*NodeInfo) Descriptor ¶
func (*NodeInfo) GetListenAddr ¶
func (*NodeInfo) GetMaxRpcParamLen ¶
func (*NodeInfo) GetNodeName ¶
func (*NodeInfo) GetPrivate ¶
func (*NodeInfo) GetPublicServiceList ¶
func (*NodeInfo) MarshalToSizedBuffer ¶
func (*NodeInfo) ProtoMessage ¶
func (*NodeInfo) ProtoMessage()
func (*NodeInfo) XXX_DiscardUnknown ¶
func (m *NodeInfo) XXX_DiscardUnknown()
func (*NodeInfo) XXX_Marshal ¶
func (*NodeInfo) XXX_Unmarshal ¶
type RawRpcCallBack ¶
type RequestHandler ¶
type RequestHandler func(Returns interface{}, Err RpcError)
type Responder ¶
type Responder = RequestHandler
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{}, rpcError RpcError)
type RpcHandleFinder ¶
type RpcHandleFinder interface {
FindRpcHandler(serviceMethod string) IRpcHandler
}
type RpcHandler ¶
type RpcHandler struct { IRpcHandlerChannel // 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{}) error
func (*RpcHandler) GetName ¶
func (handler *RpcHandler) GetName() string
func (*RpcHandler) GetRpcHandler ¶
func (handler *RpcHandler) GetRpcHandler() IRpcHandler
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, rpcHandlerChannel IRpcHandlerChannel)
func (*RpcHandler) IsSingleCoroutine ¶
func (handler *RpcHandler) IsSingleCoroutine() bool
func (*RpcHandler) RawGoNode ¶
func (handler *RpcHandler) RawGoNode(rpcProcessorType RpcProcessorType, nodeId int, rpcMethodId uint32, serviceName string, rawArgs IRawInputArgs) error
func (*RpcHandler) RegRawRpc ¶
func (handler *RpcHandler) RegRawRpc(rpcMethodId uint32, rawRpcCB RawRpcCallBack)
func (*RpcHandler) RegisterRpc ¶
func (handler *RpcHandler) RegisterRpc(rpcHandler IRpcHandler) error
func (*RpcHandler) UnmarshalInParam ¶
func (handler *RpcHandler) UnmarshalInParam(rpcProcessor IRpcProcessor, serviceMethod string, rawRpcMethodId uint32, inParam []byte) (interface{}, error)
type RpcMethodInfo ¶
type RpcMethodInfo struct {
// contains filtered or unexported fields
}
type RpcProcessorType ¶
type RpcProcessorType uint8
const ( RpcProcessorJson RpcProcessorType = 0 RpcProcessorGoGoPB RpcProcessorType = 1 )
type RpcRequest ¶
type RpcRequest struct { RpcRequestData IRpcRequestData // contains filtered or unexported fields }
func MakeRpcRequest ¶
func MakeRpcRequest(rpcProcessor IRpcProcessor, seq uint64, rpcMethodId uint32, serviceMethod string, noReply bool, inParam []byte) *RpcRequest
func (*RpcRequest) Clear ¶
func (slf *RpcRequest) Clear() *RpcRequest
func (*RpcRequest) IsRef ¶
func (slf *RpcRequest) IsRef() bool
func (*RpcRequest) Ref ¶
func (slf *RpcRequest) Ref()
func (*RpcRequest) Reset ¶
func (slf *RpcRequest) Reset()
func (*RpcRequest) UnRef ¶
func (slf *RpcRequest) UnRef()
type RpcResponse ¶
type RpcResponse struct {
RpcResponseData IRpcResponseData
}
func (*RpcResponse) Clear ¶
func (rpcResponse *RpcResponse) Clear() *RpcResponse
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Init ¶
func (server *Server) Init(rpcHandleFinder RpcHandleFinder)
type ServiceDiscoverReq ¶
type ServiceDiscoverReq struct { NodeInfo *NodeInfo `protobuf:"bytes,1,opt,name=nodeInfo,proto3" json:"nodeInfo,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Client->Master
func (*ServiceDiscoverReq) Descriptor ¶
func (*ServiceDiscoverReq) Descriptor() ([]byte, []int)
func (*ServiceDiscoverReq) GetNodeInfo ¶
func (m *ServiceDiscoverReq) GetNodeInfo() *NodeInfo
func (*ServiceDiscoverReq) Marshal ¶
func (m *ServiceDiscoverReq) Marshal() (dAtA []byte, err error)
func (*ServiceDiscoverReq) MarshalTo ¶
func (m *ServiceDiscoverReq) MarshalTo(dAtA []byte) (int, error)
func (*ServiceDiscoverReq) MarshalToSizedBuffer ¶
func (m *ServiceDiscoverReq) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ServiceDiscoverReq) ProtoMessage ¶
func (*ServiceDiscoverReq) ProtoMessage()
func (*ServiceDiscoverReq) Reset ¶
func (m *ServiceDiscoverReq) Reset()
func (*ServiceDiscoverReq) Size ¶
func (m *ServiceDiscoverReq) Size() (n int)
func (*ServiceDiscoverReq) String ¶
func (m *ServiceDiscoverReq) String() string
func (*ServiceDiscoverReq) Unmarshal ¶
func (m *ServiceDiscoverReq) Unmarshal(dAtA []byte) error
func (*ServiceDiscoverReq) XXX_DiscardUnknown ¶
func (m *ServiceDiscoverReq) XXX_DiscardUnknown()
func (*ServiceDiscoverReq) XXX_Marshal ¶
func (m *ServiceDiscoverReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ServiceDiscoverReq) XXX_Merge ¶
func (m *ServiceDiscoverReq) XXX_Merge(src proto.Message)
func (*ServiceDiscoverReq) XXX_Size ¶
func (m *ServiceDiscoverReq) XXX_Size() int
func (*ServiceDiscoverReq) XXX_Unmarshal ¶
func (m *ServiceDiscoverReq) XXX_Unmarshal(b []byte) error
type SubscribeDiscoverNotify ¶
type SubscribeDiscoverNotify struct { MasterNodeId int32 `protobuf:"varint,1,opt,name=MasterNodeId,proto3" json:"MasterNodeId,omitempty"` IsFull bool `protobuf:"varint,2,opt,name=IsFull,proto3" json:"IsFull,omitempty"` DelNodeId int32 `protobuf:"varint,3,opt,name=DelNodeId,proto3" json:"DelNodeId,omitempty"` NodeInfo []*NodeInfo `protobuf:"bytes,4,rep,name=nodeInfo,proto3" json:"nodeInfo,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Master->Client
func (*SubscribeDiscoverNotify) Descriptor ¶
func (*SubscribeDiscoverNotify) Descriptor() ([]byte, []int)
func (*SubscribeDiscoverNotify) GetDelNodeId ¶
func (m *SubscribeDiscoverNotify) GetDelNodeId() int32
func (*SubscribeDiscoverNotify) GetIsFull ¶
func (m *SubscribeDiscoverNotify) GetIsFull() bool
func (*SubscribeDiscoverNotify) GetMasterNodeId ¶
func (m *SubscribeDiscoverNotify) GetMasterNodeId() int32
func (*SubscribeDiscoverNotify) GetNodeInfo ¶
func (m *SubscribeDiscoverNotify) GetNodeInfo() []*NodeInfo
func (*SubscribeDiscoverNotify) Marshal ¶
func (m *SubscribeDiscoverNotify) Marshal() (dAtA []byte, err error)
func (*SubscribeDiscoverNotify) MarshalTo ¶
func (m *SubscribeDiscoverNotify) MarshalTo(dAtA []byte) (int, error)
func (*SubscribeDiscoverNotify) MarshalToSizedBuffer ¶
func (m *SubscribeDiscoverNotify) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*SubscribeDiscoverNotify) ProtoMessage ¶
func (*SubscribeDiscoverNotify) ProtoMessage()
func (*SubscribeDiscoverNotify) Reset ¶
func (m *SubscribeDiscoverNotify) Reset()
func (*SubscribeDiscoverNotify) Size ¶
func (m *SubscribeDiscoverNotify) Size() (n int)
func (*SubscribeDiscoverNotify) String ¶
func (m *SubscribeDiscoverNotify) String() string
func (*SubscribeDiscoverNotify) Unmarshal ¶
func (m *SubscribeDiscoverNotify) Unmarshal(dAtA []byte) error
func (*SubscribeDiscoverNotify) XXX_DiscardUnknown ¶
func (m *SubscribeDiscoverNotify) XXX_DiscardUnknown()
func (*SubscribeDiscoverNotify) XXX_Marshal ¶
func (m *SubscribeDiscoverNotify) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SubscribeDiscoverNotify) XXX_Merge ¶
func (m *SubscribeDiscoverNotify) XXX_Merge(src proto.Message)
func (*SubscribeDiscoverNotify) XXX_Size ¶
func (m *SubscribeDiscoverNotify) XXX_Size() int
func (*SubscribeDiscoverNotify) XXX_Unmarshal ¶
func (m *SubscribeDiscoverNotify) XXX_Unmarshal(b []byte) error
type TriggerRpcEvent ¶
Click to show internal directories.
Click to hide internal directories.