Documentation ¶
Index ¶
- Constants
- Variables
- func AesDecrypt(data []byte, key []byte, iv []byte) ([]byte, error)
- func AesEncrypt(data []byte, key []byte, iv []byte) ([]byte, error)
- type AppQueryUserData
- type AppRefreshTokenData
- type ClassifyRuleData
- type CreateDirectoryData
- type 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
- type FamilyUserCurrentEncodeData
- type File
- type GetDownloadUrlData
- type GetDownloadUrlV2Data
- type GetZoneInfoData
- type Header
- type Json
- type Option
- 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
- type PcWebLoginData
- type QueryAllFilesData
- type QueryCloudUsageInfoData
- type Req
- type Resp
- type RestyOption
- type Upload2CFile
- type Upload2COption
- type Upload2CResp
- type 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)
Constants ¶
View Source
const ( DefaultClientID = "1001000021" DefaultClientSecret = "XFmi9GS2hzk98jGX" DefaultAppID = "10000001" DefaultBaseURL = "https://panservice.mail.wo.cn" //DefaultZoneURL = "https://gxupload.pan.wo.cn:8443" DefaultZoneURL = "https://tjupload.pan.wo.cn" DefaultUA = "" /* 129-byte string literal not displayed */ DefaultPartSize = int64(8 * 1024 * 1024) )
View Source
const ( ChannelAPIUser = "api-user" ChannelWoHome = "wohome" ChannelWoCloud = "wocloud" )
View Source
const ( SpaceTypePersonal = "0" SpaceTypeFamily = "1" )
View Source
const ( KeyPcWebLogin = "PcWebLogin" KeyPcLoginVerifyCode = "PcLoginVerifyCode" KeyAppQueryUser = "AppQueryUser" KeyAppRefreshToken = "AppRefreshToken" KeyAppLogout = "AppLogout" )
api-user methods
View Source
const ( KeyFCloudProductOrdListQry = "FCloudProductOrdListQry" KeyQueryCloudUsageInfo = "QueryCloudUsageInfo" KeyFCloudProductPackage = "FCloudProductPackage" KeyClassifyRule = "ClassifyRule" KeyGetZoneInfo = "GetZoneInfo" KeyQuerySysConfig = "QuerySysConfig" KeyFamilyUserCurrentEncode = "FamilyUserCurrentEncode" KeyQueryAllFiles = "QueryAllFiles" KeyGetSearchDirectory = "GetSearchDirectory" KeyGetDownloadUrlV2 = "GetDownloadUrlV2" KeyGetDownloadUrl = "GetDownloadUrl" KeyCreateDirectory = "CreateDirectory" KeyRenameFileOrDirectory = "RenameFileOrDirectory" KeyMoveFile = "MoveFile" KeyCopyFile = "CopyFile" KeyDeleteFile = "DeleteFile" KeyEmptyRecycleData = "EmptyRecycleData" KeyUpload2C = "upload2C" )
wohome methods
View Source
const ( SortNameAsc = iota + 1 SortNameDesc SortSizeAsc SortSizeDesc SortTimeAsc SortTimeDesc )
Variables ¶
View Source
var ( JsonClientIDSecret = Json{ "clientId": DefaultClientID, "secret": true, } JsonSecret = Json{ "secret": true, } )
View Source
var (
ErrInvalidAccessToken = errors.New("invalid access token")
)
Functions ¶
Types ¶
type AppQueryUserData ¶
type AppQueryUserData struct { UserId string `json:"userId"` HeadUrl string `json:"headUrl"` UserName string `json:"userName"` Sex string `json:"sex"` Birthday string `json:"birthday"` IsModify string `json:"isModify"` IsHeadModify string `json:"isHeadModify"` IsSetPassword string `json:"isSetPassword"` RegisterTime string `json:"registerTime"` }
type AppRefreshTokenData ¶
type AppRefreshTokenData struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` RefreshToken string `json:"refresh_token"` ExpiresIn int `json:"expires_in"` Scope string `json:"scope"` }
AppRefreshTokenData no encrypt
type ClassifyRuleData ¶
type ClassifyRuleData struct { FileTypes map[string]struct { SubType string `json:"subType"` Ability string `json:"ability"` Type string `json:"type"` } `json:"fileTypes"` FileIcons struct { App struct { Zip string `json:"zip"` Image string `json:"image"` Other string `json:"other"` Xmind string `json:"xmind"` Gif string `json:"gif"` Csv string `json:"csv"` Video string `json:"video"` Excel string `json:"excel"` Pdf string `json:"pdf"` Ppt string `json:"ppt"` Doc string `json:"doc"` Audio string `json:"audio"` Text string `json:"text"` Word string `json:"word"` } `json:"app"` H5 struct { } `json:"h5"` } `json:"fileIcons"` }
type CreateDirectoryData ¶
type CreateDirectoryData struct {
Id string `json:"id"`
}
type Crypto ¶
type Crypto struct {
// contains filtered or unexported fields
}
func (*Crypto) EncryptBytes ¶
func (*Crypto) SetAccessToken ¶
type FCloudProductOrdListQryCtxData ¶
type FCloudProductOrdListQryCtxData struct { FcloudProductOrds []struct { ActiviteCode string `json:"activiteCode"` AppStorePackageDesc string `json:"appStorePackageDesc"` AppStorePackageFee string `json:"appStorePackageFee"` AppStoreProductId string `json:"appStoreProductId"` ApplyTime string `json:"applyTime"` ApplyTimeFormate string `json:"applyTimeFormate"` CbssOrderId string `json:"cbssOrderId"` City string `json:"city"` ClientId string `json:"clientId"` Days string `json:"days"` DescUrl string `json:"descUrl"` EffectState string `json:"effectState"` EffectiveDays int `json:"effectiveDays"` ExpireTime string `json:"expireTime"` ExpireTimeFormate string `json:"expireTimeFormate"` Fee string `json:"fee"` IsAppStorePay string `json:"isAppStorePay"` IsAutoSub string `json:"isAutoSub"` IsExpire string `json:"isExpire"` IsNewPackage string `json:"isNewPackage"` IsOnline string `json:"isOnline"` IsPlus string `json:"isPlus"` IsShowExpireTips string `json:"isShowExpireTips"` OrderId string `json:"orderId"` OrderState string `json:"orderState"` OrderStatus string `json:"orderStatus"` PackageDesc string `json:"packageDesc"` PackageProductCode string `json:"packageProductCode"` PackageProductId string `json:"packageProductId"` PayMethod string `json:"payMethod"` PayTransactionId string `json:"payTransactionId"` PayType string `json:"payType"` Province string `json:"province"` RemainDays string `json:"remainDays"` SignStatus string `json:"signStatus"` Source string `json:"source"` SubTime string `json:"subTime"` SubTimeFormate string `json:"subTimeFormate"` SubType string `json:"subType"` UserId string `json:"userId"` VipDesc string `json:"vipDesc"` VipDescNew string `json:"vipDescNew"` VipExpireTimeLabel string `json:"vipExpireTimeLabel"` VipLevel string `json:"vipLevel"` } `json:"fcloudProductOrds"` MaxVipLevel string `json:"maxVipLevel"` IsShowInlet string `json:"isShowInlet"` }
type FamilyUserCurrentEncodeData ¶
type FamilyUserCurrentEncodeData struct { Count string `json:"count"` DefaultHomeId int `json:"defaultHomeId"` DefaultHomeName string `json:"defaultHomeName"` GroupHeadUrl string `json:"groupHeadUrl"` GroupName string `json:"groupName"` Id int `json:"id"` MemberRole string `json:"memberRole"` OwnerId string `json:"owner Id"` UnreadFlag string `json:"unreadFlag"` }
type File ¶
type File struct { FamilyId int `json:"familyId"` Fid string `json:"fid"` Creator string `json:"creator"` Size int64 `json:"size"` CreateTime string `json:"createTime"` Name string `json:"name"` ShootingTime string `json:"shootingTime"` Id string `json:"id"` Type int `json:"type"` ThumbUrl string `json:"thumbUrl"` FileType string `json:"fileType"` }
type GetDownloadUrlData ¶
type GetDownloadUrlV2Data ¶
type GetZoneInfoData ¶
type GetZoneInfoData struct {
Url string `json:"url"`
}
type Option ¶
type Option func(w *WoClient)
func WithAccessToken ¶
func WithClient ¶
func WithJsonMarshalFunc ¶
func WithJsonUnmarshalFunc ¶
func WithRefreshToken ¶
func WithRestyClient ¶
func WithRestyClient(rc *resty.Client) Option
type PcLoginVerifyCodeData ¶
type PcLoginVerifyCodeData struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` ExpiresIn int `json:"expires_in"` }
PcLoginVerifyCodeData no encrypt
type PcWebLoginData ¶
type PcWebLoginData struct {
NeedSmsCode string `json:"needSmsCode"`
}
PcWebLoginData no encrypt
type QueryAllFilesData ¶
type QueryAllFilesData struct {
Files []File `json:"files"`
}
type QueryCloudUsageInfoData ¶
type QueryCloudUsageInfoData struct { Code string `json:"code"` UsageInfo struct { TotalSize string `json:"totalSize"` UsedSize int64 `json:"usedSize"` ImageSize int64 `json:"imageSize"` VideoSize int64 `json:"videoSize"` AudioSize int64 `json:"audioSize"` TextSize int64 `json:"textSize"` OtherSize int64 `json:"otherSize"` ByteUsedSize int64 `json:"byteUsedSize"` ByteTotalSize string `json:"byteTotalSize"` } `json:"usageInfo"` VipLevel string `json:"vipLevel"` ExpireTime string `json:"expireTime"` ApplyTime string `json:"applyTime"` PayType string `json:"payType"` Source string `json:"source"` OrderState string `json:"orderState"` Status string `json:"status"` }
type RestyOption ¶
type RestyOption func(request *resty.Request)
type Upload2CFile ¶
type Upload2COption ¶
type Upload2CResp ¶
type WoClient ¶
type WoClient struct { Phone string ZoneURL string ClassifyRuleData *ClassifyRuleData // contains filtered or unexported fields }
func DefaultWithAccessToken ¶
func DefaultWithRefreshToken ¶
func (*WoClient) AppLogout ¶
func (w *WoClient) AppLogout(opts ...RestyOption) error
func (*WoClient) AppQueryUser ¶
func (w *WoClient) AppQueryUser(opts ...RestyOption) (*AppQueryUserData, error)
func (*WoClient) AppRefreshToken ¶
func (w *WoClient) AppRefreshToken(opts ...RestyOption) (*AppRefreshTokenData, error)
func (*WoClient) ClassifyRule ¶
func (w *WoClient) ClassifyRule(opts ...RestyOption) (*ClassifyRuleData, error)
func (*WoClient) CreateDirectory ¶
func (w *WoClient) CreateDirectory(spaceType, parentDirectoryId string, directoryName, familyId string, opts ...RestyOption) (*CreateDirectoryData, error)
func (*WoClient) DeleteFile ¶
func (w *WoClient) DeleteFile(spaceType string, dirList, fileList []string, opts ...RestyOption) error
func (*WoClient) EmptyRecycleData ¶
func (w *WoClient) EmptyRecycleData(opts ...RestyOption) error
func (*WoClient) EnableTrace ¶
func (*WoClient) EncryptParam ¶
func (*WoClient) FCloudProductOrdListQry ¶
func (w *WoClient) FCloudProductOrdListQry(opts ...RestyOption) (*FCloudProductOrdListQryCtxData, error)
func (*WoClient) FamilyUserCurrentEncode ¶
func (w *WoClient) FamilyUserCurrentEncode(opts ...RestyOption) (*FamilyUserCurrentEncodeData, error)
func (*WoClient) GetDownloadUrl ¶
func (w *WoClient) GetDownloadUrl(spaceType string, fidList []string, opts ...RestyOption) ([]GetDownloadUrlData, error)
func (*WoClient) GetDownloadUrlV2 ¶
func (w *WoClient) GetDownloadUrlV2(fidList []string, opts ...RestyOption) (*GetDownloadUrlV2Data, error)
func (*WoClient) GetFileType ¶
func (*WoClient) GetZoneInfo ¶
func (w *WoClient) GetZoneInfo(opts ...RestyOption) (*GetZoneInfoData, error)
func (*WoClient) InitClassifyRule ¶
func (*WoClient) InitZoneURL ¶
func (*WoClient) NewRequest ¶
func (w *WoClient) NewRequest() *resty.Request
func (*WoClient) OnRefreshToken ¶
func (*WoClient) PcLoginVerifyCode ¶
func (w *WoClient) PcLoginVerifyCode(phone, password, messageCode string, opts ...RestyOption) (*PcLoginVerifyCodeData, error)
func (*WoClient) PcWebLogin ¶
func (w *WoClient) PcWebLogin(phone, password string, opts ...RestyOption) (*PcWebLoginData, error)
func (*WoClient) QueryAllFiles ¶
func (w *WoClient) QueryAllFiles(spaceType, parentDirectoryId string, pageNum, pageSize int, sortRule int, familyId string, opts ...RestyOption) (*QueryAllFilesData, error)
func (*WoClient) QueryAllFilesFamily ¶
func (w *WoClient) QueryAllFilesFamily(parentDirectoryId string, pageNum, pageSize int, sortRule int, familyId string, opts ...RestyOption) (*QueryAllFilesData, error)
func (*WoClient) QueryAllFilesPersonal ¶
func (w *WoClient) QueryAllFilesPersonal(parentDirectoryId string, pageNum, pageSize int, sortRule int, opts ...RestyOption) (*QueryAllFilesData, error)
func (*WoClient) QueryCloudUsageInfo ¶
func (w *WoClient) QueryCloudUsageInfo(opts ...RestyOption) (*QueryCloudUsageInfoData, error)
func (*WoClient) RefreshToken ¶
func (*WoClient) RenameFileOrDirectory ¶
func (w *WoClient) RenameFileOrDirectory(spaceType string, _type int, id string, name string, familyId string, opts ...RestyOption) error
RenameFileOrDirectory _type: 1: file, 0: directory
func (*WoClient) RenameFileOrDirectoryFamily ¶
func (*WoClient) RenameFileOrDirectoryPersonal ¶
func (*WoClient) RequestApiUser ¶
func (*WoClient) RequestWoHome ¶
func (*WoClient) SetAccessToken ¶
func (*WoClient) SetHttpClient ¶
func (*WoClient) SetJsonMarshalFunc ¶
func (*WoClient) SetJsonUnmarshalFunc ¶
func (*WoClient) SetRefreshToken ¶
func (*WoClient) SetUserAgent ¶
func (*WoClient) Upload2C ¶
func (w *WoClient) Upload2C(spaceType string, file Upload2CFile, targetDirId string, familyId string, opt Upload2COption) (string, error)
func (*WoClient) Upload2CFamily ¶
func (w *WoClient) Upload2CFamily(file Upload2CFile, targetDirId string, familyId string, opt Upload2COption) (string, error)
func (*WoClient) Upload2CPersonal ¶
func (w *WoClient) Upload2CPersonal(file Upload2CFile, targetDirId string, opt Upload2COption) (string, error)
Click to show internal directories.
Click to hide internal directories.