19 lines
470 B
Go
19 lines
470 B
Go
|
package hpds_net_framework
|
||
|
|
||
|
// Encryptor interface
|
||
|
type Encryptor interface {
|
||
|
Encode(bs []byte) []byte
|
||
|
Decode(bs []byte) []byte
|
||
|
}
|
||
|
|
||
|
// Processor interface
|
||
|
type Processor interface {
|
||
|
SetBigEndian()
|
||
|
GetBigEndian() bool
|
||
|
SetEncryptor(enc Encryptor)
|
||
|
OnReceivedPackage(interface{}, []byte) error
|
||
|
WrapMsg(interface{}) ([]byte, error)
|
||
|
WrapIdMsg(id uint32, data interface{}) ([]byte, error)
|
||
|
RegisterHandler(id int, entity interface{}, handle func(args ...interface{}))
|
||
|
}
|