hpds_net_framework/message.go

19 lines
470 B
Go
Raw Normal View History

2022-08-03 16:55:40 +08:00
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{}))
}