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

+3 -13
View File
@@ -2,23 +2,13 @@ package message
// choke: <len=0001><id=0>
type Choke struct {
Message
*base
}
func NewChoke() *Choke {
return &Choke{
Message{
Length: 1,
ID: IdChoke,
base: &base{
id: IdChoke,
},
}
}
func (c *Choke) Encode() []byte {
return c.Message.Encode()
}
func (c *Choke) Decode(buf []byte) Serialize {
c.Message.Decode(buf)
return c
}