Documentation ¶
Index ¶
Constants ¶
View Source
const ( EncryptTypeNotNeedEncrypt = 0x00 EncryptTypeEncryptByD2Key = 0x01 EncryptTypeEncryptByZeros = 0x02 )
View Source
const ( FlagNoCompression = 0x00000000 FlagZlibCompression = 0x00000001 )
View Source
const ( VersionDefault = 0x0000000a VersionSimple = 0x0000000b )
Variables ¶
View Source
var ( ErrCachedPush = errors.New("cached push") ErrNotHandled = errors.New("not handled") ErrHeartbeatTimeout = errors.New("heartbeat timeout") ErrWriteClosed = errors.New("write closed") ErrWriteTimeout = errors.New("write timeout") )
View Source
var (
ContextErrorKey = struct{}{}
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { BindCancelFunc(cancel context.CancelFunc) DialDefault(ctx context.Context) error Dial(ctx context.Context, network, address string) error Close() error Go(serviceMethod string, args *Args, reply *Reply, done chan *Call) *Call Call(serviceMethod string, args *Args, reply *Reply) error Handle(serviceMethod string, reply *Reply) (*Args, error) Register(serviceMethod string, handler Handler) error GetNextSeq() int32 GetFakeSource(uin int64) *fake.Source GetServerTime() int64 GetSession(uin int64) *Session GetTickets(uin int64) *Tickets SetSession(uin int64, tlvs map[uint16]tlv.Codec) SetSessionAuth(uin int64, auth []byte) SetSessionCookie(uin int64, cookie []byte) SetTickets(uin int64, tlvs map[uint16]tlv.Codec) }
type Key16Bytes ¶
type Key16Bytes [16]byte
func (*Key16Bytes) Get ¶
func (v *Key16Bytes) Get() [16]byte
func (Key16Bytes) MarshalJSON ¶
func (v Key16Bytes) MarshalJSON() ([]byte, error)
func (*Key16Bytes) Set ¶
func (v *Key16Bytes) Set(b [16]byte)
func (*Key16Bytes) UnmarshalJSON ¶
func (v *Key16Bytes) UnmarshalJSON(b []byte) error
type Reply ¶
type Reply struct { Version uint32 `json:"version,omitempty"` Uin int64 `json:"uin,omitempty"` Seq int32 `json:"seq,omitempty"` Code int32 `json:"code,omitempty"` Message string `json:"message,omitempty"` ServiceMethod string `json:"service_method,omitempty"` Cookie []byte `json:"cookie,omitempty"` Flag uint32 `json:"flag,omitempty"` ReserveField []byte `json:"reserve_field,omitempty"` Payload []byte `json:"-"` }
type Sender ¶
type Session ¶
type Session struct { Auth []byte `json:"auth,omitempty"` Cookie []byte `json:"cookie,omitempty"` RandomKey Key16Bytes `json:"random_key,omitempty"` RandomPass Key16Bytes `json:"random_pass,omitempty"` PrivateKey *ecdh.PrivateKey `json:"-"` KeyVersion int16 `json:"key_version,omitempty"` }
type Ticket ¶
type Ticket struct { Key Key16Bytes `json:"key,omitempty"` Sig []byte `json:"sig,omitempty"` Exp int64 `json:"exp,omitempty"` Iss int64 `json:"iss,omitempty"` }
type Tickets ¶
type Tickets struct { A1 *Ticket `json:"a1,omitempty"` A2 *Ticket `json:"a2,omitempty"` A5 *Ticket `json:"a5,omitempty"` A8 *Ticket `json:"a8,omitempty"` D2 *Ticket `json:"d2,omitempty"` LSKey *Ticket `json:"lskey,omitempty"` SKey *Ticket `json:"skey,omitempty"` SID *Ticket `json:"sid,omitempty"` Sig64 *Ticket `json:"sig64,omitempty"` SuperKey *Ticket `json:"super_key,omitempty"` ST *Ticket `json:"st,omitempty"` STWeb *Ticket `json:"stweb,omitempty"` VKey *Ticket `json:"vkey,omitempty"` Domains map[string]string `json:"domains,omitempty"` KSID []byte `json:"ksid,omitempty"` }
Click to show internal directories.
Click to hide internal directories.