mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-13 07:04:44 +08:00
优化代码规范
This commit is contained in:
@@ -1,19 +1,18 @@
|
||||
package processor
|
||||
|
||||
|
||||
type IProcessor interface {
|
||||
// must goroutine safe
|
||||
MsgRoute(clientId string,msg interface{},recyclerReaderBytes func(data []byte)) error
|
||||
//must goroutine safe
|
||||
UnknownMsgRoute(clientId string,msg interface{},recyclerReaderBytes func(data []byte))
|
||||
// connect event
|
||||
// MsgRoute must goroutine safe
|
||||
MsgRoute(clientId string, msg interface{}, recyclerReaderBytes func(data []byte)) error
|
||||
// UnknownMsgRoute must goroutine safe
|
||||
UnknownMsgRoute(clientId string, msg interface{}, recyclerReaderBytes func(data []byte))
|
||||
// ConnectedRoute connect event
|
||||
ConnectedRoute(clientId string)
|
||||
DisConnectedRoute(clientId string)
|
||||
|
||||
// must goroutine safe
|
||||
Unmarshal(clientId string,data []byte) (interface{}, error)
|
||||
// must goroutine safe
|
||||
Marshal(clientId string,msg interface{}) ([]byte, error)
|
||||
// Unmarshal must goroutine safe
|
||||
Unmarshal(clientId string, data []byte) (interface{}, error)
|
||||
// Marshal must goroutine safe
|
||||
Marshal(clientId string, msg interface{}) ([]byte, error)
|
||||
}
|
||||
|
||||
type IRawProcessor interface {
|
||||
@@ -21,9 +20,8 @@ type IRawProcessor interface {
|
||||
|
||||
SetByteOrder(littleEndian bool)
|
||||
SetRawMsgHandler(handle RawMessageHandler)
|
||||
MakeRawMsg(msgType uint16,msg []byte,pbRawPackInfo *PBRawPackInfo)
|
||||
MakeRawMsg(msgType uint16, msg []byte, pbRawPackInfo *PBRawPackInfo)
|
||||
SetUnknownMsgHandler(unknownMessageHandler UnknownRawMessageHandler)
|
||||
SetConnectedHandler(connectHandler RawConnectHandler)
|
||||
SetDisConnectedHandler(disconnectHandler RawConnectHandler)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user