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=2>
type Interested struct {
Message
*base
}
func NewInterested() *Interested {
return &Interested{
Message{
Length: 1,
ID: IdInterested,
base: &base{
id: IdInterested,
},
}
}
func (c *Interested) Encode() []byte {
return c.Message.Encode()
}
func (c *Interested) Decode(buf []byte) Serialize {
c.Message.Decode(buf)
return c
}