Documentation
¶
Index ¶
- func Push(chlCtx service.IChannelContext, msgMsgID uint16, v interface{}) error
- func PushClose(chlCtx service.IChannelContext, msgMsgID uint16, v interface{}, desc string) error
- func Response(chlCtx service.IChannelContext, msgSeqID uint32, msgMsgID uint16, ...) error
- func ResponseClose(chlCtx service.IChannelContext, msgSeqID uint32, msgMsgID uint16, ...) error
- type Message
- func NewMessage(routeType Type, messageType Type, verion Type, seqID uint32, msgID uint16, ...) (this *Message)
- func NewMessageDirect(routeType Type, messageType Type, verion Type, seqID uint32, msgID uint16, ...) (this *Message)
- func NewMessageWith(data []byte) (this *Message)
- func ResponseMessage(msgSeqID uint32, msgMsgID uint16, v interface{}) *Message
- func (msg *Message) Decode(e []byte) error
- func (msg *Message) Encode() ([]byte, error)
- func (msg *Message) GetMsgData() []byte
- func (msg *Message) GetMsgID() uint16
- func (msg *Message) GetSecurityType() int8
- func (msg *Message) GetSeqID() uint32
- func (msg *Message) GetSerializeType() int8
- func (msg *Message) String() string
- type MessageFactory
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PushClose ¶
func PushClose(chlCtx service.IChannelContext, msgMsgID uint16, v interface{}, desc string) error
func Response ¶
func Response(chlCtx service.IChannelContext, msgSeqID uint32, msgMsgID uint16, v interface{}) error
func ResponseClose ¶
Types ¶
type Message ¶
type Message struct {
RouteType Type // 路由类型: 0-close,1-client,2-hall
MessageType Type // 协议类型: 1-proto,2-json
Verion Type // 协议版本
SeqID uint32 // 消息唯一ID,从0开始递增
Time int64 // 时间戳
MsgID uint16 // 协议ID
Data []byte // 协议数据
ProtoData protoiface.MessageV1
}
Message represents a unmarshaled message or a message which to be marshaled
func NewMessage ¶
func NewMessage(routeType Type, messageType Type, verion Type, seqID uint32, msgID uint16, protoData protoreflect.ProtoMessage) (this *Message)
func NewMessageDirect ¶
func NewMessageWith ¶
func ResponseMessage ¶
func (*Message) GetMsgData ¶
func (*Message) GetSecurityType ¶
func (*Message) GetSerializeType ¶
type MessageFactory ¶
type MessageFactory struct {
}
func NewMessageFactory ¶
func NewMessageFactory() (this *MessageFactory)
func (*MessageFactory) GetProtocol ¶
func (factory *MessageFactory) GetProtocol(buf []byte) (valid bool, ret protocol.Protocol)
Click to show internal directories.
Click to hide internal directories.