Documentation ¶
Index ¶
- Constants
- type ConnectHandler
- type ConnectJsonHandler
- type IProcessor
- type IRawProcessor
- type JsonPackInfo
- type JsonProcessor
- func (jsonProcessor *JsonProcessor) ConnectedRoute(clientId uint64)
- func (jsonProcessor *JsonProcessor) DisConnectedRoute(clientId uint64)
- func (jsonProcessor *JsonProcessor) MakeMsg(msgType uint16, msg interface{}) *JsonPackInfo
- func (jsonProcessor *JsonProcessor) MakeRawMsg(msgType uint16, msg []byte) *JsonPackInfo
- func (jsonProcessor *JsonProcessor) Marshal(clientId uint64, msg interface{}) ([]byte, error)
- func (jsonProcessor *JsonProcessor) MsgRoute(clientId uint64, msg interface{}) error
- func (jsonProcessor *JsonProcessor) Register(msgtype uint16, msg interface{}, handle MessageJsonHandler)
- func (jsonProcessor *JsonProcessor) RegisterConnected(connectHandler ConnectJsonHandler)
- func (jsonProcessor *JsonProcessor) RegisterDisConnected(disconnectHandler ConnectJsonHandler)
- func (jsonProcessor *JsonProcessor) RegisterUnknownMsg(unknownMessageHandler UnknownMessageJsonHandler)
- func (jsonProcessor *JsonProcessor) SetByteOrder(littleEndian bool)
- func (jsonProcessor *JsonProcessor) UnknownMsgRoute(clientId uint64, msg interface{})
- func (jsonProcessor *JsonProcessor) Unmarshal(clientId uint64, data []byte) (interface{}, error)
- type MessageHandler
- type MessageInfo
- type MessageJsonHandler
- type MessageJsonInfo
- type PBPackInfo
- type PBProcessor
- func (pbProcessor *PBProcessor) ConnectedRoute(clientId uint64)
- func (pbProcessor *PBProcessor) DisConnectedRoute(clientId uint64)
- func (pbProcessor *PBProcessor) MakeMsg(msgType uint16, protoMsg proto.Message) *PBPackInfo
- func (pbProcessor *PBProcessor) MakeRawMsg(msgType uint16, msg []byte) *PBPackInfo
- func (pbProcessor *PBProcessor) Marshal(clientId uint64, msg interface{}) ([]byte, error)
- func (pbProcessor *PBProcessor) MsgRoute(clientId uint64, msg interface{}) error
- func (pbProcessor *PBProcessor) Register(msgtype uint16, msg proto.Message, handle MessageHandler)
- func (pbProcessor *PBProcessor) RegisterConnected(connectHandler ConnectHandler)
- func (pbProcessor *PBProcessor) RegisterDisConnected(disconnectHandler ConnectHandler)
- func (pbProcessor *PBProcessor) RegisterSendMsg(msgtype uint16, msg proto.Message)
- func (pbProcessor *PBProcessor) RegisterUnknownMsg(unknownMessageHandler UnknownMessageHandler)
- func (pbProcessor *PBProcessor) SetByteOrder(littleEndian bool)
- func (pbProcessor *PBProcessor) UnknownMsgRoute(clientId uint64, msg interface{})
- func (pbProcessor *PBProcessor) Unmarshal(clientId uint64, data []byte) (interface{}, error)
- type PBRawPackInfo
- type PBRawProcessor
- func (pbRawProcessor *PBRawProcessor) ConnectedRoute(clientId uint64)
- func (pbRawProcessor *PBRawProcessor) DisConnectedRoute(clientId uint64)
- func (pbRawProcessor *PBRawProcessor) MakeRawMsg(msgType uint16, msg []byte, pbRawPackInfo *PBRawPackInfo)
- func (pbRawProcessor *PBRawProcessor) Marshal(clientId uint64, msg interface{}) ([]byte, error)
- func (pbRawProcessor *PBRawProcessor) MsgRoute(clientId uint64, msg interface{}) error
- func (pbRawProcessor *PBRawProcessor) SetByteOrder(littleEndian bool)
- func (pbRawProcessor *PBRawProcessor) SetConnectedHandler(connectHandler RawConnectHandler)
- func (pbRawProcessor *PBRawProcessor) SetDisConnectedHandler(disconnectHandler RawConnectHandler)
- func (pbRawProcessor *PBRawProcessor) SetRawMsgHandler(handle RawMessageHandler)
- func (pbRawProcessor *PBRawProcessor) SetUnknownMsgHandler(unknownMessageHandler UnknownRawMessageHandler)
- func (pbRawProcessor *PBRawProcessor) UnknownMsgRoute(clientId uint64, msg interface{})
- func (pbRawProcessor *PBRawProcessor) Unmarshal(clientId uint64, data []byte) (interface{}, error)
- type RawConnectHandler
- type RawMessageHandler
- type RawMessageInfo
- type UnknownMessageHandler
- type UnknownMessageJsonHandler
- type UnknownRawMessageHandler
Constants ¶
View Source
const MsgTypeSize = 2
View Source
const RawMsgTypeSize = 2
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectHandler ¶
type ConnectHandler func(clientId uint64)
type ConnectJsonHandler ¶
type ConnectJsonHandler func(clientId uint64)
type IProcessor ¶
type IProcessor interface { // must goroutine safe MsgRoute(clientId uint64, msg interface{}) error //must goroutine safe UnknownMsgRoute(clientId uint64, msg interface{}) // connect event ConnectedRoute(clientId uint64) DisConnectedRoute(clientId uint64) // must goroutine safe Unmarshal(clientId uint64, data []byte) (interface{}, error) // must goroutine safe Marshal(clientId uint64, msg interface{}) ([]byte, error) }
type IRawProcessor ¶
type IRawProcessor interface { IProcessor SetByteOrder(littleEndian bool) SetRawMsgHandler(handle RawMessageHandler) MakeRawMsg(msgType uint16, msg []byte, pbRawPackInfo *PBRawPackInfo) SetUnknownMsgHandler(unknownMessageHandler UnknownRawMessageHandler) SetConnectedHandler(connectHandler RawConnectHandler) SetDisConnectedHandler(disconnectHandler RawConnectHandler) }
type JsonPackInfo ¶
type JsonPackInfo struct {
// contains filtered or unexported fields
}
func (*JsonPackInfo) GetMsg ¶
func (slf *JsonPackInfo) GetMsg() interface{}
func (*JsonPackInfo) GetPackType ¶
func (slf *JsonPackInfo) GetPackType() uint16
type JsonProcessor ¶
type JsonProcessor struct { LittleEndian bool network.INetMempool // contains filtered or unexported fields }
func NewJsonProcessor ¶
func NewJsonProcessor() *JsonProcessor
func (*JsonProcessor) ConnectedRoute ¶
func (jsonProcessor *JsonProcessor) ConnectedRoute(clientId uint64)
func (*JsonProcessor) DisConnectedRoute ¶
func (jsonProcessor *JsonProcessor) DisConnectedRoute(clientId uint64)
func (*JsonProcessor) MakeMsg ¶
func (jsonProcessor *JsonProcessor) MakeMsg(msgType uint16, msg interface{}) *JsonPackInfo
func (*JsonProcessor) MakeRawMsg ¶
func (jsonProcessor *JsonProcessor) MakeRawMsg(msgType uint16, msg []byte) *JsonPackInfo
func (*JsonProcessor) Marshal ¶
func (jsonProcessor *JsonProcessor) Marshal(clientId uint64, msg interface{}) ([]byte, error)
func (*JsonProcessor) MsgRoute ¶
func (jsonProcessor *JsonProcessor) MsgRoute(clientId uint64, msg interface{}) error
must goroutine safe
func (*JsonProcessor) Register ¶
func (jsonProcessor *JsonProcessor) Register(msgtype uint16, msg interface{}, handle MessageJsonHandler)
func (*JsonProcessor) RegisterConnected ¶
func (jsonProcessor *JsonProcessor) RegisterConnected(connectHandler ConnectJsonHandler)
func (*JsonProcessor) RegisterDisConnected ¶
func (jsonProcessor *JsonProcessor) RegisterDisConnected(disconnectHandler ConnectJsonHandler)
func (*JsonProcessor) RegisterUnknownMsg ¶
func (jsonProcessor *JsonProcessor) RegisterUnknownMsg(unknownMessageHandler UnknownMessageJsonHandler)
func (*JsonProcessor) SetByteOrder ¶
func (jsonProcessor *JsonProcessor) SetByteOrder(littleEndian bool)
func (*JsonProcessor) UnknownMsgRoute ¶
func (jsonProcessor *JsonProcessor) UnknownMsgRoute(clientId uint64, msg interface{})
type MessageHandler ¶
type MessageInfo ¶
type MessageInfo struct {
// contains filtered or unexported fields
}
type MessageJsonHandler ¶
type MessageJsonHandler func(clientId uint64, msg interface{})
type MessageJsonInfo ¶
type MessageJsonInfo struct {
// contains filtered or unexported fields
}
type PBPackInfo ¶
type PBPackInfo struct {
// contains filtered or unexported fields
}
func (*PBPackInfo) GetMsg ¶
func (slf *PBPackInfo) GetMsg() proto.Message
func (*PBPackInfo) GetPackType ¶
func (slf *PBPackInfo) GetPackType() uint16
type PBProcessor ¶
type PBProcessor struct { LittleEndian bool network.INetMempool // contains filtered or unexported fields }
func NewPBProcessor ¶
func NewPBProcessor() *PBProcessor
func (*PBProcessor) ConnectedRoute ¶
func (pbProcessor *PBProcessor) ConnectedRoute(clientId uint64)
connect event
func (*PBProcessor) DisConnectedRoute ¶
func (pbProcessor *PBProcessor) DisConnectedRoute(clientId uint64)
func (*PBProcessor) MakeMsg ¶
func (pbProcessor *PBProcessor) MakeMsg(msgType uint16, protoMsg proto.Message) *PBPackInfo
func (*PBProcessor) MakeRawMsg ¶
func (pbProcessor *PBProcessor) MakeRawMsg(msgType uint16, msg []byte) *PBPackInfo
func (*PBProcessor) Marshal ¶
func (pbProcessor *PBProcessor) Marshal(clientId uint64, msg interface{}) ([]byte, error)
must goroutine safe
func (*PBProcessor) MsgRoute ¶
func (pbProcessor *PBProcessor) MsgRoute(clientId uint64, msg interface{}) error
must goroutine safe
func (*PBProcessor) Register ¶
func (pbProcessor *PBProcessor) Register(msgtype uint16, msg proto.Message, handle MessageHandler)
func (*PBProcessor) RegisterConnected ¶
func (pbProcessor *PBProcessor) RegisterConnected(connectHandler ConnectHandler)
func (*PBProcessor) RegisterDisConnected ¶
func (pbProcessor *PBProcessor) RegisterDisConnected(disconnectHandler ConnectHandler)
func (*PBProcessor) RegisterSendMsg ¶
func (pbProcessor *PBProcessor) RegisterSendMsg(msgtype uint16, msg proto.Message)
func (*PBProcessor) RegisterUnknownMsg ¶
func (pbProcessor *PBProcessor) RegisterUnknownMsg(unknownMessageHandler UnknownMessageHandler)
func (*PBProcessor) SetByteOrder ¶
func (pbProcessor *PBProcessor) SetByteOrder(littleEndian bool)
func (*PBProcessor) UnknownMsgRoute ¶
func (pbProcessor *PBProcessor) UnknownMsgRoute(clientId uint64, msg interface{})
type PBRawPackInfo ¶
type PBRawPackInfo struct {
// contains filtered or unexported fields
}
func (*PBRawPackInfo) GetMsg ¶
func (slf *PBRawPackInfo) GetMsg() []byte
func (*PBRawPackInfo) GetPackType ¶
func (slf *PBRawPackInfo) GetPackType() uint16
func (*PBRawPackInfo) SetPackInfo ¶
func (slf *PBRawPackInfo) SetPackInfo(typ uint16, rawMsg []byte)
type PBRawProcessor ¶
type PBRawProcessor struct { LittleEndian bool // contains filtered or unexported fields }
func NewPBRawProcessor ¶
func NewPBRawProcessor() *PBRawProcessor
func (*PBRawProcessor) ConnectedRoute ¶
func (pbRawProcessor *PBRawProcessor) ConnectedRoute(clientId uint64)
connect event
func (*PBRawProcessor) DisConnectedRoute ¶
func (pbRawProcessor *PBRawProcessor) DisConnectedRoute(clientId uint64)
func (*PBRawProcessor) MakeRawMsg ¶
func (pbRawProcessor *PBRawProcessor) MakeRawMsg(msgType uint16, msg []byte, pbRawPackInfo *PBRawPackInfo)
func (*PBRawProcessor) Marshal ¶
func (pbRawProcessor *PBRawProcessor) Marshal(clientId uint64, msg interface{}) ([]byte, error)
must goroutine safe
func (*PBRawProcessor) MsgRoute ¶
func (pbRawProcessor *PBRawProcessor) MsgRoute(clientId uint64, msg interface{}) error
must goroutine safe
func (*PBRawProcessor) SetByteOrder ¶
func (pbRawProcessor *PBRawProcessor) SetByteOrder(littleEndian bool)
func (*PBRawProcessor) SetConnectedHandler ¶
func (pbRawProcessor *PBRawProcessor) SetConnectedHandler(connectHandler RawConnectHandler)
func (*PBRawProcessor) SetDisConnectedHandler ¶
func (pbRawProcessor *PBRawProcessor) SetDisConnectedHandler(disconnectHandler RawConnectHandler)
func (*PBRawProcessor) SetRawMsgHandler ¶
func (pbRawProcessor *PBRawProcessor) SetRawMsgHandler(handle RawMessageHandler)
func (*PBRawProcessor) SetUnknownMsgHandler ¶
func (pbRawProcessor *PBRawProcessor) SetUnknownMsgHandler(unknownMessageHandler UnknownRawMessageHandler)
func (*PBRawProcessor) UnknownMsgRoute ¶
func (pbRawProcessor *PBRawProcessor) UnknownMsgRoute(clientId uint64, msg interface{})
type RawConnectHandler ¶
type RawConnectHandler func(clientId uint64)
type RawMessageHandler ¶
type RawMessageInfo ¶
type RawMessageInfo struct {
// contains filtered or unexported fields
}
type UnknownMessageHandler ¶
Click to show internal directories.
Click to hide internal directories.