Versions in this module Expand all Collapse all v0 v0.1.2 Nov 28, 2024 Changes in this version + var ErrAuthenticationFailed = errors.New("authentication failed") v0.1.1 Nov 9, 2024 Changes in this version type Packet + SequenceID uint32 v0.1.0 Oct 6, 2024 Changes in this version + const RequestTypeLogin + const RequestTypeNT + 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 Packet struct + CommandName string + Params RequestParams + Payload []byte + SequenceId uint32 + type Request struct + Body []byte + CommandName string + SequenceID uint32 + Sign *sign.Response + 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.DeviceInfo + Sig auth.SigInfo + Version *auth.AppInfo + func (t *Transport) PackPacket(req *Request) []byte + func (t *Transport) ReadResponse(head []byte) (*Response, error)