FILE / ScuroNeko/mtg

mtproto/rpc/handshake_request.go

Исходный файл и его история в репозитории.
FILE 51a60441f32a157aff1b6a112bd4eca230b5d7f4
Files
mtg/mtproto/rpc/handshake_request.go
T
2018-07-08 13:24:48 +03:00

23 lines
446 B
Go

package rpc
import "bytes"
type HandshakeRequest struct {
}
func (r *HandshakeRequest) Bytes() []byte {
buf := &bytes.Buffer{}
buf.Grow(len(TagHandshake) + len(HandshakeFlags) + len(HandshakeSenderPID) + len(HandshakePeerPID))
buf.Write(TagHandshake)
buf.Write(HandshakeFlags)
buf.Write(HandshakeSenderPID)
buf.Write(HandshakePeerPID)
return buf.Bytes()
}
func NewHandshakeRequest() *HandshakeRequest {
return &HandshakeRequest{}
}