Versions in this module Expand all Collapse all v0 v0.1.2 Oct 10, 2023 v0.1.1 Jun 17, 2023 Changes in this version + const ChannelAPIUser + const ChannelWoCloud + const ChannelWoHome + const DefaultAppID + const DefaultBaseURL + const DefaultClientID + const DefaultClientSecret + const DefaultPartSize + const DefaultUA + const DefaultZoneURL + const KeyAppLogout + const KeyAppQueryUser + const KeyAppRefreshToken + const KeyClassifyRule + const KeyCopyFile + const KeyCreateDirectory + const KeyDeleteFile + const KeyEmptyRecycleData + const KeyFCloudProductOrdListQry + const KeyFCloudProductPackage + const KeyFamilyUserCurrentEncode + const KeyGetDownloadUrl + const KeyGetDownloadUrlV2 + const KeyGetSearchDirectory + const KeyGetZoneInfo + const KeyMoveFile + const KeyPcLoginVerifyCode + const KeyPcWebLogin + const KeyQueryAllFiles + const KeyQueryCloudUsageInfo + const KeyQuerySysConfig + const KeyRenameFileOrDirectory + const KeyUpload2C + const SortNameAsc + const SortNameDesc + const SortSizeAsc + const SortSizeDesc + const SortTimeAsc + const SortTimeDesc + const SpaceTypeFamily + const SpaceTypePersonal + var ErrInvalidAccessToken = errors.New("invalid access token") + var JsonClientIDSecret = Json + var JsonSecret = Json + func AesDecrypt(data []byte, key []byte, iv []byte) ([]byte, error) + func AesEncrypt(data []byte, key []byte, iv []byte) ([]byte, error) + type AppQueryUserData struct + Birthday string + HeadUrl string + IsHeadModify string + IsModify string + IsSetPassword string + RegisterTime string + Sex string + UserId string + UserName string + type AppRefreshTokenData struct + AccessToken string + ExpiresIn int + RefreshToken string + Scope string + TokenType string + type ClassifyRuleData struct + FileIcons struct{ ... } + FileTypes map[string]struct{ ... } + type CreateDirectoryData struct + Id string + type Crypto struct + func NewCrypto() *Crypto + func (c *Crypto) Decrypt(content string, channel string) (string, error) + func (c *Crypto) Encrypt(content string, channel string) (string, error) + func (c *Crypto) EncryptBytes(bs []byte, channel string) (string, error) + func (c *Crypto) SetAccessToken(token string) error + func (c *Crypto) UserDecrypt(content string) (string, error) + func (c *Crypto) UserEncrypt(content string) (string, error) + func (c *Crypto) WoHomeDecrypt(content string) (string, error) + func (c *Crypto) WoHomeEncrypt(content string) (string, error) + type FCloudProductOrdListQryCtxData struct + FcloudProductOrds []struct{ ... } + IsShowInlet string + MaxVipLevel string + type FamilyUserCurrentEncodeData struct + Count string + DefaultHomeId int + DefaultHomeName string + GroupHeadUrl string + GroupName string + Id int + MemberRole string + OwnerId string + UnreadFlag string + type File struct + CreateTime string + Creator string + FamilyId int + Fid string + FileType string + Id string + Name string + ShootingTime string + Size int64 + ThumbUrl string + Type int + type GetDownloadUrlData struct + DownloadUrl string + Fid string + type GetDownloadUrlV2Data struct + List []struct{ ... } + Type int + type GetZoneInfoData struct + Url string + type Header struct + Channel string + Key string + ReqSeq int + ResTime int64 + Sign string + Version string + type Json map[string]interface + type Option func(w *WoClient) + func WithAccessToken(token string) Option + func WithClient(hc *http.Client) Option + func WithDebug() Option + func WithJsonMarshalFunc(f func(v interface{}) ([]byte, error)) Option + func WithJsonUnmarshalFunc(f func(data []byte, v interface{}) error) Option + func WithProxy(proxy string) Option + func WithRefreshToken(token string) Option + func WithRestyClient(rc *resty.Client) Option + func WithTrace() Option + func WithUA(ua string) Option + type PcLoginVerifyCodeData struct + AccessToken string + ExpiresIn int + RefreshToken string + type PcWebLoginData struct + NeedSmsCode string + type QueryAllFilesData struct + Files []File + type QueryCloudUsageInfoData struct + ApplyTime string + Code string + ExpireTime string + OrderState string + PayType string + Source string + Status string + UsageInfo struct{ ... } + VipLevel string + type Req struct + Body T + type Resp struct + LogID string + Msg string + Rsp struct{ ... } + Status string + type RestyOption func(request *resty.Request) + type Upload2CFile struct + Content io.Reader + ContentType string + Name string + Size int64 + type Upload2COption struct + Ctx context.Context + OnProgress func(current, total int64) + type Upload2CResp struct + Code string + Data struct{ ... } + Msg string + type WoClient struct + ClassifyRuleData *ClassifyRuleData + Phone string + ZoneURL string + func Default() *WoClient + func DefaultWithAccessToken(accessToken string) *WoClient + func DefaultWithRefreshToken(refreshToken string) *WoClient + func New(opts ...Option) *WoClient + func (w *WoClient) AppLogout(opts ...RestyOption) error + func (w *WoClient) AppQueryUser(opts ...RestyOption) (*AppQueryUserData, error) + func (w *WoClient) AppRefreshToken(opts ...RestyOption) (*AppRefreshTokenData, error) + func (w *WoClient) ClassifyRule(opts ...RestyOption) (*ClassifyRuleData, error) + func (w *WoClient) CopyFile(dirList, fileList []string, targetDirId string, sourceType, targetType string, ...) error + func (w *WoClient) CreateDirectory(spaceType, parentDirectoryId string, directoryName, familyId string, ...) (*CreateDirectoryData, error) + func (w *WoClient) DeleteFile(spaceType string, dirList, fileList []string, opts ...RestyOption) error + func (w *WoClient) EmptyRecycleData(opts ...RestyOption) error + func (w *WoClient) EnableTrace() *WoClient + func (w *WoClient) EncryptParam(channel string, param Json) (string, error) + func (w *WoClient) FCloudProductOrdListQry(opts ...RestyOption) (*FCloudProductOrdListQryCtxData, error) + func (w *WoClient) FamilyUserCurrentEncode(opts ...RestyOption) (*FamilyUserCurrentEncodeData, error) + func (w *WoClient) GetDownloadUrl(spaceType string, fidList []string, opts ...RestyOption) ([]GetDownloadUrlData, error) + func (w *WoClient) GetDownloadUrlV2(fidList []string, opts ...RestyOption) (*GetDownloadUrlV2Data, error) + func (w *WoClient) GetFileType(filename string) string + func (w *WoClient) GetToken() (string, string) + func (w *WoClient) GetZoneInfo(opts ...RestyOption) (*GetZoneInfoData, error) + func (w *WoClient) InitClassifyRule() error + func (w *WoClient) InitData() error + func (w *WoClient) InitPhone() error + func (w *WoClient) InitZoneURL() error + func (w *WoClient) MoveFile(dirList, fileList []string, targetDirId string, sourceType, targetType string, ...) error + func (w *WoClient) NewBody(channel string, param, other Json) (Json, error) + func (w *WoClient) NewRequest() *resty.Request + func (w *WoClient) OnRefreshToken(f func(accessToken, refreshToken string)) + func (w *WoClient) PcLoginVerifyCode(phone, password, messageCode string, opts ...RestyOption) (*PcLoginVerifyCodeData, error) + func (w *WoClient) PcWebLogin(phone, password string, opts ...RestyOption) (*PcWebLoginData, error) + func (w *WoClient) QueryAllFiles(spaceType, parentDirectoryId string, pageNum, pageSize int, sortRule int, ...) (*QueryAllFilesData, error) + func (w *WoClient) QueryAllFilesFamily(parentDirectoryId string, pageNum, pageSize int, sortRule int, familyId string, ...) (*QueryAllFilesData, error) + func (w *WoClient) QueryAllFilesPersonal(parentDirectoryId string, pageNum, pageSize int, sortRule int, ...) (*QueryAllFilesData, error) + func (w *WoClient) QueryCloudUsageInfo(opts ...RestyOption) (*QueryCloudUsageInfoData, error) + func (w *WoClient) RefreshToken() error + func (w *WoClient) RenameFileOrDirectory(spaceType string, _type int, id string, name string, familyId string, ...) error + func (w *WoClient) RenameFileOrDirectoryFamily(_type int, id string, name string, familyId string, opts ...RestyOption) error + func (w *WoClient) RenameFileOrDirectoryPersonal(_type int, id string, name string, opts ...RestyOption) error + func (w *WoClient) Request(channel string, key string, param, other Json, resp interface{}, ...) ([]byte, error) + func (w *WoClient) RequestApiUser(key string, param, other Json, resp interface{}, opts ...RestyOption) ([]byte, error) + func (w *WoClient) RequestWoHome(key string, param, other Json, resp interface{}, opts ...RestyOption) ([]byte, error) + func (w *WoClient) SetAccessToken(token string) + func (w *WoClient) SetDebug(d bool) *WoClient + func (w *WoClient) SetHttpClient(httpClient *http.Client) *WoClient + func (w *WoClient) SetJsonMarshalFunc(f func(v interface{}) ([]byte, error)) + func (w *WoClient) SetJsonUnmarshalFunc(f func(data []byte, v interface{}) error) + func (w *WoClient) SetProxy(proxy string) *WoClient + func (w *WoClient) SetRefreshToken(token string) + func (w *WoClient) SetUA(ua string) + func (w *WoClient) SetUserAgent(userAgent string) *WoClient + func (w *WoClient) Upload2C(spaceType string, file Upload2CFile, targetDirId string, familyId string, ...) (string, error) + func (w *WoClient) Upload2CFamily(file Upload2CFile, targetDirId string, familyId string, opt Upload2COption) (string, error) + func (w *WoClient) Upload2CPersonal(file Upload2CFile, targetDirId string, opt Upload2COption) (string, error)