relay

package
v4.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 9 Imported by: 1

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 cellnet.Session or cellnet.TCPConnector")
)

Functions

func Relay

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

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

func ResoleveInboundEvent

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

处理入站的relay消息

func ResolveOutboundEvent

func ResolveOutboundEvent(inputEvent cellnet.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 added in v0.0.3

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

type RecvMsgEvent

type RecvMsgEvent struct {
	Ses cellnet.Session

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

func (*RecvMsgEvent) Message

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

func (*RecvMsgEvent) PassThroughAsInt64 added in v0.0.3

func (self *RecvMsgEvent) PassThroughAsInt64() int64

func (*RecvMsgEvent) PassThroughAsInt64Slice added in v0.0.3

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

func (*RecvMsgEvent) PassThroughAsString added in v0.0.3

func (self *RecvMsgEvent) PassThroughAsString() string

func (*RecvMsgEvent) Reply added in v0.0.3

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

消息原路返回

func (*RecvMsgEvent) Session

func (self *RecvMsgEvent) Session() cellnet.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 added in v0.0.3

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

func (*RelayACK) Size added in v0.0.3

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

func (*RelayACK) String

func (self *RelayACK) String() string

func (*RelayACK) Unmarshal added in v0.0.3

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