relay

package
v0.0.0-...-26c2032 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Generated by github.com/davyxu/protoplus DO NOT EDIT!

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPeerSession = errors.New("Require valid cellnetEx.Session or cellnetEx.TCPConnector")
)

Functions

func Relay

func Relay(sesDetector interface{}, dataList ...interface{}) error

payload: msg/bytes passthrough: int64, []int64, string

func ResoleveInboundEvent

func ResoleveInboundEvent(inputEvent cellnetEx.Event) (ouputEvent cellnetEx.Event, handled bool, err error)

处理入站的relay消息

func ResolveOutboundEvent

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

处理relay.Relay出站消息的日志

func SetBroadcaster

func SetBroadcaster(callback BroadcasterFunc)

设置广播函数, 回调时,按对应Peer/Session所在的队列中调用

Types

type BroadcasterFunc

type BroadcasterFunc func(event *RecvMsgEvent)

type PassthroughContent

type PassthroughContent struct {
	Int64      int64   // 透传int64
	Int64Slice []int64 // 透传int64切片
	Str        string
}

type RecvMsgEvent

type RecvMsgEvent struct {
	Ses cellnetEx.Session

	Msg interface{}
	// contains filtered or unexported fields
}

func (*RecvMsgEvent) Message

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

func (*RecvMsgEvent) PassThroughAsInt64

func (self *RecvMsgEvent) PassThroughAsInt64() int64

func (*RecvMsgEvent) PassThroughAsInt64Slice

func (self *RecvMsgEvent) PassThroughAsInt64Slice() []int64

func (*RecvMsgEvent) PassThroughAsString

func (self *RecvMsgEvent) PassThroughAsString() string

func (*RecvMsgEvent) Reply

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

消息原路返回

func (*RecvMsgEvent) Session

func (self *RecvMsgEvent) Session() cellnetEx.Session

type RelayACK

type RelayACK struct {
	Msg        []byte  `text:"-"` // 数据消息转换后传输bytes
	MsgID      uint32  `text:"-"` // 消息ID
	Bytes      []byte  `text:"-"` // 数据bytes
	Int64      int64   // 透传int64
	Int64Slice []int64 // 透传int64切片
	Str        string
}

func (*RelayACK) Marshal

func (self *RelayACK) Marshal(buffer *proto.Buffer) error

func (*RelayACK) Size

func (self *RelayACK) Size() (ret int)

func (*RelayACK) String

func (self *RelayACK) String() string

func (*RelayACK) Unmarshal

func (self *RelayACK) Unmarshal(buffer *proto.Buffer, fieldIndex uint64, wt proto.WireType) error

Jump to

Keyboard shortcuts

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