rpc

package
v0.0.0-...-1c5b680 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPeerSession = errors.New("rpc: Invalid peer type, require lib.RPCSessionGetter or lib.Session")
	ErrEmptySession       = errors.New("rpc: Empty session")
)
View Source
var ErrTimeout = errors.New("RPC time out3")

Functions

func Call

func Call(sesOrPeer interface{}, reqMsg interface{}, timeout time.Duration, userCallback func(raw interface{}))

func CallSync

func CallSync(ud interface{}, reqMsg interface{}, timeout time.Duration) (interface{}, error)

func ResolveInboundEvent

func ResolveInboundEvent(inputEvent lib.Event) (outputEvent lib.Event, handled bool, err error)

func ResolveOutboundEvent

func ResolveOutboundEvent(inputEvent lib.Event) (handled bool, err error)

Types

type RPCSessionGetter

type RPCSessionGetter interface {
	RPCSession() lib.Session
}

type RecvMsgEvent

type RecvMsgEvent struct {
	Msg interface{}
	// contains filtered or unexported fields
}

func (*RecvMsgEvent) Message

func (this *RecvMsgEvent) Message() interface{}

func (*RecvMsgEvent) Queue

func (this *RecvMsgEvent) Queue() lib.EventQueue

func (*RecvMsgEvent) Reply

func (this *RecvMsgEvent) Reply(msg interface{})

func (*RecvMsgEvent) Session

func (this *RecvMsgEvent) Session() lib.Session

type RemoteCallAck

type RemoteCallAck struct {
	MsgId                int32    `protobuf:"varint,1,opt,name=MsgId,proto3" json:"MsgId,omitempty"`
	Data                 []byte   `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"`
	CallId               int64    `protobuf:"varint,3,opt,name=CallId,proto3" json:"CallId,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RemoteCallAck) Descriptor

func (*RemoteCallAck) Descriptor() ([]byte, []int)

func (*RemoteCallAck) GetCallId

func (m *RemoteCallAck) GetCallId() int64

func (*RemoteCallAck) GetData

func (m *RemoteCallAck) GetData() []byte

func (*RemoteCallAck) GetMsgData

func (self *RemoteCallAck) GetMsgData() []byte

func (self *RemoteCallAck) GetMsgId() uint16 { return uint16(self.MsgId) }

func (*RemoteCallAck) GetMsgId

func (m *RemoteCallAck) GetMsgId() int32

func (*RemoteCallAck) ProtoMessage

func (*RemoteCallAck) ProtoMessage()

func (*RemoteCallAck) Reset

func (m *RemoteCallAck) Reset()

func (*RemoteCallAck) String

func (m *RemoteCallAck) String() string

func (*RemoteCallAck) XXX_DiscardUnknown

func (m *RemoteCallAck) XXX_DiscardUnknown()

func (*RemoteCallAck) XXX_Marshal

func (m *RemoteCallAck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RemoteCallAck) XXX_Merge

func (m *RemoteCallAck) XXX_Merge(src proto.Message)

func (*RemoteCallAck) XXX_Size

func (m *RemoteCallAck) XXX_Size() int

func (*RemoteCallAck) XXX_Unmarshal

func (m *RemoteCallAck) XXX_Unmarshal(b []byte) error

type RemoteCallMsg

type RemoteCallMsg interface {
	GetMsgId() int32
	GetMsgData() []byte
	GetCallId() int64
}

type RemoteCallReq

type RemoteCallReq struct {
	MsgId                int32    `protobuf:"varint,1,opt,name=MsgId,proto3" json:"MsgId,omitempty"`
	Data                 []byte   `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"`
	CallId               int64    `protobuf:"varint,3,opt,name=CallId,proto3" json:"CallId,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RemoteCallReq) Descriptor

func (*RemoteCallReq) Descriptor() ([]byte, []int)

func (*RemoteCallReq) GetCallId

func (m *RemoteCallReq) GetCallId() int64

func (*RemoteCallReq) GetData

func (m *RemoteCallReq) GetData() []byte

func (*RemoteCallReq) GetMsgData

func (self *RemoteCallReq) GetMsgData() []byte

func (self *RemoteCallReq) GetMsgId() uint16 { return uint16(self.MsgId) }

func (*RemoteCallReq) GetMsgId

func (m *RemoteCallReq) GetMsgId() int32

func (*RemoteCallReq) ProtoMessage

func (*RemoteCallReq) ProtoMessage()

func (*RemoteCallReq) Reset

func (m *RemoteCallReq) Reset()

func (*RemoteCallReq) String

func (m *RemoteCallReq) String() string

func (*RemoteCallReq) XXX_DiscardUnknown

func (m *RemoteCallReq) XXX_DiscardUnknown()

func (*RemoteCallReq) XXX_Marshal

func (m *RemoteCallReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RemoteCallReq) XXX_Merge

func (m *RemoteCallReq) XXX_Merge(src proto.Message)

func (*RemoteCallReq) XXX_Size

func (m *RemoteCallReq) XXX_Size() int

func (*RemoteCallReq) XXX_Unmarshal

func (m *RemoteCallReq) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL