Versions in this module Expand all Collapse all v0 v0.2.0 Jul 22, 2026 v0.1.0 Jul 22, 2026 Changes in this version + const DefaultAppVersion + const DefaultHeartbeatInterval + const DefaultSDKVersion + func DecodeIOSRegisterBody(bodyHex string) []string + func DecodeRegisterResponse(bodyHex string) []string + func TryDecryptSeed(frame []byte, offset int, seed int64) string + type Ack struct + RequestCommand int + STime int64 + Status int + Step int + func (*Ack) Command() int + type Candidate struct + BodyHex string + BodyOffset int + FirstField string + KeyMode string + Parts []string + Valid bool + type Client struct + func New(cfg Config) *Client + func (c *Client) Close() error + func (c *Client) RegID() string + func (c *Client) Register(ctx context.Context) (*Credentials, error) + func (c *Client) Run(ctx context.Context, onPush func(Push) error) error + func (c *Client) SetAlias(ctx context.Context, alias string) error + func (c *Client) WaitForPush(ctx context.Context, match func(Push) bool) (Push, error) + type Codec interface + Decode func(frame []byte) (Response, error) + EncodeHeartbeat func(rid, juid int64, sid int) []byte + EncodeLogin func(rid, juid int64, p LoginParams) []byte + EncodePushAck func(rid, juid int64, sid, code, msgType int, msgID int64) []byte + EncodeRegister func(rid int64, p RegisterParams) []byte + EncodeSetAlias func(rid, juid int64, sid int, appKey, action string) []byte + type Config struct + AppKey string + AppVersion string + Channel string + ClientInfo string + ClientVersion int + Codec Codec + DeviceModel string + Dial func(ctx context.Context, network, addr string) (net.Conn, error) + HeartbeatInterval time.Duration + Logger func(format string, args ...any) + PackageName string + Platform Platform + RegBusiness int + SDKVersion string + SISHosts []string + Servers []string + Store Store + type Credentials struct + AndroidID string + DeviceID string + DeviceToken string + JUID int64 + Password string + RegID string + UDID string + type FileStore struct + Path string + func (f FileStore) Load() (*Credentials, error) + func (f FileStore) Save(c *Credentials) error + type FrameInfo struct + Candidates []Candidate + Command int + Encrypted bool + JUID int64 + Length int + Seed uint32 + Version int + func InspectFrame(frame []byte) (*FrameInfo, error) + type JCore473Codec struct + func NewJCore473Codec() *JCore473Codec + func NewJCore473CodecIOS() *JCore473Codec + func (c *JCore473Codec) Decode(f []byte) (Response, error) + func (c *JCore473Codec) EncodeHeartbeat(rid, juid int64, sid int) []byte + func (c *JCore473Codec) EncodeLogin(rid, juid int64, p LoginParams) []byte + func (c *JCore473Codec) EncodePushAck(rid, juid int64, sid, code, msgType int, msgID int64) []byte + func (c *JCore473Codec) EncodeRegister(rid int64, p RegisterParams) []byte + func (c *JCore473Codec) EncodeSetAlias(rid, juid int64, sid int, appKey, action string) []byte + type JHeadCodec struct + func (JHeadCodec) Decode(f []byte) (Response, error) + func (JHeadCodec) EncodeHeartbeat(rid, juid int64, sid int) []byte + func (JHeadCodec) EncodeLogin(rid, juid int64, p LoginParams) []byte + func (JHeadCodec) EncodePushAck(rid, juid int64, sid, code, msgType int, msgID int64) []byte + func (JHeadCodec) EncodeRegister(rid int64, p RegisterParams) []byte + func (JHeadCodec) EncodeSetAlias(rid, juid int64, sid int, appKey, action string) []byte + type LoginParams struct + AppKey string + ClientVersion int + DeviceHash string + PasswordMD5 string + VersionString string + type LoginResult struct + Code int + Error string + SID int + ServerTime int + ServerVersion int + SessionKey string + func (*LoginResult) Command() int + type Platform int + const PlatformAndroid + const PlatformIOS + type Push struct + Content string + MsgID int64 + MsgType int + func (*Push) Command() int + func (p Push) Fields() (map[string]any, error) + type RegisterParams struct + APKVersion string + AccountID string + AdvertisingID string + ApsType int + BuildType int + ClientInfo string + DeviceToken string + Key string + KeyExt string + RegBusiness int + type RegisterResult struct + Code int + DeviceID string + Error string + JUID int64 + Password string + RegID string + func (*RegisterResult) Command() int + type Response interface + Command func() int + type Store interface + Load func() (*Credentials, error) + Save func(*Credentials) error