Documentation ¶
Index ¶
- Variables
- func Relay(sesDetector interface{}, dataList ...interface{}) error
- func ResolveInboundEvent(inputEvent lib.Event) (outputEvent lib.Event, handled bool, err error)
- func ResolveOutboundEvent(inputEvent lib.Event) (handled bool, err error)
- func SetBroadcaster(callback BroadcasterFunc)
- type BroadcasterFunc
- type PassthroughContent
- type RecvMsgEvent
- func (this *RecvMsgEvent) Message() interface{}
- func (this *RecvMsgEvent) PassThroughAsInt64() int64
- func (this *RecvMsgEvent) PassThroughAsInt64Slice() []int64
- func (this *RecvMsgEvent) PassThroughAsString() string
- func (this *RecvMsgEvent) Reply(msg interface{})
- func (this *RecvMsgEvent) Session() lib.Session
- type RelayAck
- func (*RelayAck) Descriptor() ([]byte, []int)
- func (m *RelayAck) GetBytes() []byte
- func (m *RelayAck) GetInt64() int64
- func (m *RelayAck) GetInt64Slice() []int64
- func (m *RelayAck) GetMsg() []byte
- func (m *RelayAck) GetMsgId() int32
- func (m *RelayAck) GetStr() string
- func (*RelayAck) ProtoMessage()
- func (m *RelayAck) Reset()
- func (m *RelayAck) String() string
- func (m *RelayAck) XXX_DiscardUnknown()
- func (m *RelayAck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RelayAck) XXX_Merge(src proto.Message)
- func (m *RelayAck) XXX_Size() int
- func (m *RelayAck) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidPeerSession = errors.New("Require valid lib.Session or lib.TCPConnector")
)
Functions ¶
func Relay ¶
func Relay(sesDetector interface{}, dataList ...interface{}) error
payload: msg/bytes passthrough: int64, []int64, string
func ResolveInboundEvent ¶
func ResolveOutboundEvent ¶
func SetBroadcaster ¶
func SetBroadcaster(callback BroadcasterFunc)
设置广播函数, 回调时,按对应Peer/Session所在的队列中调用
Types ¶
type BroadcasterFunc ¶
type BroadcasterFunc func(event *RecvMsgEvent)
type PassthroughContent ¶
type RecvMsgEvent ¶
type RecvMsgEvent struct { Ses lib.Session Msg interface{} // contains filtered or unexported fields }
func (*RecvMsgEvent) Message ¶
func (this *RecvMsgEvent) Message() interface{}
func (*RecvMsgEvent) PassThroughAsInt64 ¶
func (this *RecvMsgEvent) PassThroughAsInt64() int64
func (*RecvMsgEvent) PassThroughAsInt64Slice ¶
func (this *RecvMsgEvent) PassThroughAsInt64Slice() []int64
func (*RecvMsgEvent) PassThroughAsString ¶
func (this *RecvMsgEvent) PassThroughAsString() string
func (*RecvMsgEvent) Session ¶
func (this *RecvMsgEvent) Session() lib.Session
type RelayAck ¶
type RelayAck struct { Msg []byte `protobuf:"bytes,1,opt,name=Msg,proto3" json:"Msg,omitempty"` MsgId int32 `protobuf:"varint,2,opt,name=MsgId,proto3" json:"MsgId,omitempty"` Bytes []byte `protobuf:"bytes,3,opt,name=Bytes,proto3" json:"Bytes,omitempty"` Int64 int64 `protobuf:"varint,4,opt,name=Int64,proto3" json:"Int64,omitempty"` Int64Slice []int64 `protobuf:"varint,5,rep,packed,name=Int64Slice,proto3" json:"Int64Slice,omitempty"` Str string `protobuf:"bytes,6,opt,name=Str,proto3" json:"Str,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*RelayAck) Descriptor ¶
func (*RelayAck) GetInt64Slice ¶
func (*RelayAck) ProtoMessage ¶
func (*RelayAck) ProtoMessage()
func (*RelayAck) XXX_DiscardUnknown ¶
func (m *RelayAck) XXX_DiscardUnknown()
func (*RelayAck) XXX_Marshal ¶
func (*RelayAck) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.