mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-06 00:25:43 +00:00
25 lines
336 B
Go
25 lines
336 B
Go
package message
|
|
|
|
// unchoke: <len=0001><id=1>
|
|
type Unchoke struct {
|
|
Message
|
|
}
|
|
|
|
func NewUnchoke() *Unchoke {
|
|
return &Unchoke{
|
|
Message{
|
|
Length: 1,
|
|
ID: IdUnchoke,
|
|
},
|
|
}
|
|
}
|
|
|
|
func (u *Unchoke) Encode() []byte {
|
|
return u.Message.Encode()
|
|
}
|
|
|
|
func (u *Unchoke) Decode(buf []byte) Serialize {
|
|
u.Message.Decode(buf)
|
|
return u
|
|
}
|