Documentation
¶
Index ¶
- type CallbacksMap
- type Context
- type ExtraVer
- type Features
- type ImageMetadataGetter
- type KeepaliveSettings
- type LoginInfo
- type MutableContext
- type OfflineMonitor
- type OneOrMany
- type Option
- func WithAPIType(t uint) Option
- func WithAPIVersion(v uint) Option
- func WithCheckUpdate(v bool) Option
- func WithHTTPClient(c *http.Client) Option
- func WithImageMetadataGetter(f ImageMetadataGetter) Option
- func WithLogLevel(level uint8) Option
- func WithLogging(v bool) Option
- func WithSelfListen(v bool) Option
- type OptionsSnapshot
- type QueueCtrlActionIDMap
- type Seal
- type SecretKey
- type ServerInfo
- type Settings
- type ShareFileSettings
- type SocketDebug
- type SocketRetryConfig
- type SocketSettings
- type UploadCallback
- type ZpwServiceMap
- type ZpwServiceMapV3
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallbacksMap ¶
type CallbacksMap struct {
// contains filtered or unexported fields
}
func NewCallbacksMap ¶
func NewCallbacksMap() *CallbacksMap
func (*CallbacksMap) Close ¶
func (c *CallbacksMap) Close()
func (*CallbacksMap) Delete ¶
func (c *CallbacksMap) Delete(key string)
func (*CallbacksMap) Get ¶
func (c *CallbacksMap) Get(key string) (UploadCallback, bool)
func (*CallbacksMap) Len ¶
func (c *CallbacksMap) Len() int
func (*CallbacksMap) Set ¶
func (c *CallbacksMap) Set(key string, value UploadCallback, ttl time.Duration) *CallbacksMap
type Context ¶
type Context interface {
UID() string
IMEI() string
UserAgent() string
Language() string
APIType() uint
APIVersion() uint
Options() OptionsSnapshot
IsLogging() bool
LogLevel() uint8
CheckUpdate() bool
GetImageMetadata(path string) (model.AttachmentMetadata, string, error)
CookieJar() http.CookieJar
SecretKey() SecretKey
LoginInfo() *LoginInfo
Settings() *Settings
ExtraVer() *ExtraVer
UploadCallback() *CallbacksMap
ZPWWebsocket() []string
WSPingInterval() time.Duration
ZPWServiceMap() *ZpwServiceMap
GetZpwService(service string) []string
}
type ExtraVer ¶
type ExtraVer struct {
Phonebook uint `json:"phonebook"`
ConvLabel string `json:"conv_label"`
Friend string `json:"friend"`
VerStickerGiphySuggest uint `json:"ver_sticker_giphy_suggest"`
VerGiphyCate uint `json:"ver_giphy_cate"`
Alias string `json:"alias"`
VerStickerCateList uint `json:"ver_sticker_cate_list"`
BlockFriend string `json:"block_friend"`
}
type Features ¶
type Features struct {
Socket SocketSettings `json:"socket"`
}
type ImageMetadataGetter ¶
type ImageMetadataGetter func(filePath string) (model.AttachmentMetadata, error)
type KeepaliveSettings ¶
type LoginInfo ¶
type LoginInfo struct {
UID string `json:"uid"`
ZPWEnk string `json:"zpw_enk"`
HasPCClient uint `json:"haspcclient"`
PublicIP string `json:"public_ip"`
Language string `json:"language"`
Send2meID string `json:"send2me_id"`
ZpwWebsocket []string `json:"zpw_ws"`
ZpwServiceMapV3 ZpwServiceMapV3 `json:"zpw_service_map_v3"`
}
type MutableContext ¶
type MutableContext interface {
Context
SealLogin(seal Seal) // one-shot finalization
Client() *http.Client
Proxy() func(*http.Request) (*url.URL, error)
SetIMEI(imei string)
SetUserAgent(ua string)
SetLanguage(lang string)
SetCookieJar(j http.CookieJar)
AsReadOnly() Context
}
func NewContext ¶
func NewContext(optFns ...Option) MutableContext
type OfflineMonitor ¶
type OfflineMonitor struct {
Enable bool `json:"enable"`
}
type OneOrMany ¶
type OneOrMany[T any] struct { Values []T }
func (OneOrMany[T]) MarshalJSON ¶
func (*OneOrMany[T]) UnmarshalJSON ¶
type Option ¶
type Option func(*options)
func WithAPIType ¶
func WithAPIVersion ¶
func WithCheckUpdate ¶
func WithHTTPClient ¶
func WithImageMetadataGetter ¶
func WithImageMetadataGetter(f ImageMetadataGetter) Option
func WithLogLevel ¶
func WithLogging ¶
func WithSelfListen ¶
type OptionsSnapshot ¶
type QueueCtrlActionIDMap ¶
type ServerInfo ¶
type ServerInfo struct {
Settings *Settings `json:"settings"`
ExtraVer *ExtraVer `json:"extra_ver"`
}
func (*ServerInfo) UnmarshalJSON ¶
func (s *ServerInfo) UnmarshalJSON(data []byte) error
type Settings ¶
type Settings struct {
Features Features `json:"features"`
Keepalive KeepaliveSettings `json:"keepalive"`
}
type ShareFileSettings ¶
type ShareFileSettings struct {
}
type SocketDebug ¶
type SocketDebug struct {
Enable bool `json:"enable"`
}
type SocketRetryConfig ¶
type SocketSettings ¶
type SocketSettings struct {
RotateErrorCodes []int `json:"rotate_error_codes"`
Retries map[string]SocketRetryConfig `json:"retries"`
Debug SocketDebug `json:"debug"`
PingInterval int `json:"ping_interval"`
ResetEndpoint uint `json:"reset_endpoint"`
QueueCtrlAction QueueCtrlActionIDMap `json:"queue_ctrl_actionid_map"`
CloseAndRetry []int `json:"close_and_retry_codes"`
MaxMsgSize uint `json:"max_msg_size"`
EnableCtrlSocket bool `json:"enable_ctrl_socket"`
ReconnectAfterFB bool `json:"reconnect_after_fallback"`
EnableChatSocket bool `json:"enable_chat_socket"`
SubmitWssLog bool `json:"submit_wss_log"`
DisableLP bool `json:"disable_lp"`
OfflineMonitor OfflineMonitor `json:"offline_monitor"`
}
type UploadCallback ¶
type UploadCallback = func(data model.UploadAttachment)
type ZpwServiceMap ¶
type ZpwServiceMap = ZpwServiceMapV3
type ZpwServiceMapV3 ¶
type ZpwServiceMapV3 struct {
OtherContact []string `json:"other_contact"`
ChatE2E []string `json:"chat_e2e"`
Workspace []string `json:"workspace"`
Catalog []string `json:"catalog"`
Boards []string `json:"boards"`
DownloadStickerUrl []string `json:"download_sticker_url"`
SpContact []string `json:"sp_contact"`
ZcloudUpFile []string `json:"zcloud_up_file"`
MediaStoreSend2me []string `json:"media_store_send2me"`
PushAct []string `json:"push_act"`
Aext []string `json:"aext"`
Zfamily []string `json:"zfamily"`
GroupPoll []string `json:"group_poll"`
GroupCloudMessage []string `json:"group_cloud_message"`
MediaStore []string `json:"media_store"`
File []string `json:"file"`
AutoReply []string `json:"auto_reply"`
SyncAction []string `json:"sync_action"`
FriendLan []string `json:"friend_lan"`
Friend []string `json:"friend"`
Alias []string `json:"alias"`
Zimsg []string `json:"zimsg"`
GroupBoard []string `json:"group_board"`
Conversation []string `json:"conversation"`
Group []string `json:"group"`
FallbackLP []string `json:"fallback_LP"`
FriendBoard []string `json:"friend_board"`
UpFile []string `json:"up_file"`
Zavi []string `json:"zavi"`
Reaction []string `json:"reaction"`
VoiceCall []string `json:"voice_call"`
Profile []string `json:"profile"`
Sticker []string `json:"sticker"`
Label []string `json:"label"`
Consent []string `json:"consent"`
Zcloud []string `json:"zcloud"`
Chat []string `json:"chat"`
TodoUrl []string `json:"todoUrl"`
RecentSearch []string `json:"recent_search"`
GroupE2E []string `json:"group_e2e"`
QuickMessage []string `json:"quick_message"`
}
Click to show internal directories.
Click to hide internal directories.