refactor: message entity

This commit is contained in:
liwei committed 2020-04-23 09:56:17 +08:00
1 parent 1d2f38d7ae
commit d6d411f48c
12 files changed
+167 -151

No files matched your search

+4 -14
View File
@@ -1,24 +1,14 @@
package message
// choke: <len=0001><id=0>
// choke: <len=0001><id=3>
type NotInterested struct {
Message
*base
}
func NewNotInterested() *NotInterested {
return &NotInterested{
Message{
Length: 1,
ID: IdNotinterested,
base: &base{
id: IdNotInterested,
},
}
}
func (ni *NotInterested) Encode() []byte {
return ni.Message.Encode()
}
func (ni *NotInterested) Decode(buf []byte) Serialize {
ni.Message.Decode(buf)
return ni
}