Versions in this module Expand all Collapse all v0 v0.0.1 Dec 21, 2022 Changes in this version + const RequestTypeLogin + const RequestTypeSimple + var ErrConnectionClosed = errors.New("connection closed") + var ErrInvalidPacketType = errors.New("invalid packet type") + var ErrPacketDropped = errors.New("packet dropped") + var ErrSessionExpired = errors.New("session expired") + type EncryptType uint32 + const EncryptTypeD2Key + const EncryptTypeEmptyKey + const EncryptTypeNoEncrypt + type IncomingPacketInfo struct + CommandName string + Params RequestParams + SequenceId uint16 + type Request struct + Body []byte + CommandName string + EncryptType EncryptType + SequenceID int32 + Type RequestType + Uin int64 + type RequestParams map[string]any + func (p RequestParams) Bool(k string) bool + func (p RequestParams) Int32(k string) int32 + type RequestType uint32 + type Response struct + Body []byte + CommandName string + EncryptType EncryptType + Message string + SequenceID int32 + Type RequestType + Uin int64 + type TCPClient struct + func (t *TCPClient) Close() + func (t *TCPClient) Connect(addr string) error + func (t *TCPClient) PlannedDisconnect(f func(*TCPClient)) + func (t *TCPClient) ReadBytes(len int) ([]byte, error) + func (t *TCPClient) ReadInt32() (int32, error) + func (t *TCPClient) UnexpectedDisconnect(f func(*TCPClient, error)) + func (t *TCPClient) Write(buf []byte) error + type Transport struct + Device *auth.Device + Sig *auth.SigInfo + Version *auth.AppVersion + func (t *Transport) PackPacket(req *Request) []byte + func (t *Transport) ReadResponse(head []byte) (*Response, error)