Documentation ¶
Index ¶
- Constants
- Variables
- func IsErrorCode(err error, code string) bool
- type Client
- func (r *Client) Authenticate(forceRefresh bool, service *string) (finalErr error)
- func (r *Client) Close() error
- func (r *Client) ConfigPath(configName string) string
- func (r *Client) DriveCli() (*DriveService, error)
- func (r *Client) LoadConfig(configName string) ([]byte, error)
- func (r *Client) PhotoCli() (*PhotoService, error)
- func (r *Client) SaveConfig(configName string, data []byte) error
- type ClientOption
- type DriveFolder
- type DriveService
- type Error
- type PhotoAlbum
- func (r *PhotoAlbum) GetPhotosByCount(count int) ([]*PhotoAsset, error)
- func (r *PhotoAlbum) GetPhotosByOffset(offset, limit int64) ([]*PhotoAsset, error)
- func (r *PhotoAlbum) GetSize() (int64, error)
- func (r *PhotoAlbum) PhotosIter(startOffset int64) PhotosIterNext
- func (r *PhotoAlbum) Size() int64
- func (r *PhotoAlbum) WalkPhotos(offset int64, f func(offset int64, assets []*PhotoAsset) error) error
- type PhotoAsset
- func (r *PhotoAsset) AddDate() time.Time
- func (r *PhotoAsset) AssetDate() time.Time
- func (r *PhotoAsset) Bytes() []byte
- func (r *PhotoAsset) Delete() error
- func (r *PhotoAsset) Download(version PhotoVersion, livePhoto bool) (io.ReadCloser, error)
- func (r *PhotoAsset) DownloadTo(version PhotoVersion, livePhoto bool, target string) error
- func (r *PhotoAsset) Filename(livePhoto bool) string
- func (r *PhotoAsset) FormatSize() string
- func (r *PhotoAsset) ID() string
- func (r *PhotoAsset) IsLivePhoto() bool
- func (r *PhotoAsset) LocalPath(outputDir string, size PhotoVersion, fileStructure string, livePhoto bool) string
- func (r *PhotoAsset) OldOutputDir(output, folderStructure string) string
- func (r *PhotoAsset) OutputDir(output, folderStructure string) string
- func (r *PhotoAsset) Size() int
- type PhotoService
- type PhotoVersion
- type PhotosIterNext
- type SessionData
- type TextGetter
- type User
- type ValidateData
- type ValidateDataApp
- type ValidateDataDsInfo
Constants ¶
View Source
const ( AlbumNameAll = "All Photos" AlbumNameTimeLapse = "Time-lapse" AlbumNameVideos = "Videos" AlbumNameSloMo = "Slo-mo" AlbumNameBursts = "Bursts" AlbumNameFavorites = "Favorites" AlbumNamePanoramas = "Panoramas" AlbumNameScreenshots = "Screenshots" AlbumNameLive = "Live" AlbumNameRecentlyDeleted = "Recently Deleted" AlbumNameHidden = "Hidden" )
View Source
const ( DriveRootID = "FOLDER::com.apple.CloudDocs::root" DriveTrashID = "TRASH_ROOT" )
Variables ¶
View Source
var ( ErrValidateCodeWrong = NewError("-21669", "validate code wrong") ErrPhotosIterateEnd = NewError("photos_iterate_end", "photos iterate end") ErrResourceGone = NewHttpError(410, "resource gone") )
Functions ¶
func IsErrorCode ¶
Types ¶
type Client ¶
type Client struct { Data *ValidateData // contains filtered or unexported fields }
func NewClient ¶
func NewClient(option *ClientOption) (*Client, error)
func (*Client) Authenticate ¶
func (*Client) ConfigPath ¶ added in v0.8.0
func (*Client) DriveCli ¶ added in v0.8.0
func (r *Client) DriveCli() (*DriveService, error)
func (*Client) LoadConfig ¶ added in v0.8.0
func (*Client) PhotoCli ¶
func (r *Client) PhotoCli() (*PhotoService, error)
type ClientOption ¶
type ClientOption struct { AppID string CookieDir string PasswordGetter TextGetter TwoFACodeGetter TextGetter Domain string // com,cn }
type DriveFolder ¶ added in v0.8.0
type DriveFolder struct { DateCreated time.Time `json:"dateCreated"` Drivewsid string `json:"drivewsid"` Docwsid string `json:"docwsid"` Zone string `json:"zone"` Name string `json:"name"` ParentId string `json:"parentId"` Etag string `json:"etag"` Type string `json:"type"` AssetQuota int `json:"assetQuota,omitempty"` FileCount int `json:"fileCount,omitempty"` DirectChildrenCount int `json:"directChildrenCount,omitempty"` MaxDepth string `json:"maxDepth,omitempty"` Icons []struct { Url string `json:"url"` Type string `json:"type"` Size int `json:"size"` } `json:"icons,omitempty"` SupportedExtensions []string `json:"supportedExtensions,omitempty"` SupportedTypes []string `json:"supportedTypes,omitempty"` Extension string `json:"extension,omitempty"` DateModified time.Time `json:"dateModified,omitempty"` DateChanged time.Time `json:"dateChanged,omitempty"` Size int `json:"size,omitempty"` }
type DriveService ¶ added in v0.8.0
type DriveService struct {
// contains filtered or unexported fields
}
func (*DriveService) CreateFolder ¶ added in v0.8.0
func (r *DriveService) CreateFolder(parentDriveID, name string) (*DriveFolder, error)
func (*DriveService) Folders ¶ added in v0.8.0
func (r *DriveService) Folders(driveID string) (int, []*DriveFolder, error)
type Error ¶
func NewHttpError ¶ added in v0.12.0
type PhotoAlbum ¶
type PhotoAlbum struct { // attr Name string ListType string ObjType string Direction string QueryFilter []*folderMetaDataQueryFilter // contains filtered or unexported fields }
func (*PhotoAlbum) GetPhotosByCount ¶
func (r *PhotoAlbum) GetPhotosByCount(count int) ([]*PhotoAsset, error)
func (*PhotoAlbum) GetPhotosByOffset ¶
func (r *PhotoAlbum) GetPhotosByOffset(offset, limit int64) ([]*PhotoAsset, error)
func (*PhotoAlbum) GetSize ¶
func (r *PhotoAlbum) GetSize() (int64, error)
func (*PhotoAlbum) PhotosIter ¶
func (r *PhotoAlbum) PhotosIter(startOffset int64) PhotosIterNext
func (*PhotoAlbum) Size ¶
func (r *PhotoAlbum) Size() int64
func (*PhotoAlbum) WalkPhotos ¶ added in v0.9.0
func (r *PhotoAlbum) WalkPhotos(offset int64, f func(offset int64, assets []*PhotoAsset) error) error
type PhotoAsset ¶
type PhotoAsset struct {
// contains filtered or unexported fields
}
func (*PhotoAsset) AddDate ¶ added in v0.21.1
func (r *PhotoAsset) AddDate() time.Time
func (*PhotoAsset) AssetDate ¶ added in v0.21.1
func (r *PhotoAsset) AssetDate() time.Time
func (*PhotoAsset) Bytes ¶ added in v0.9.0
func (r *PhotoAsset) Bytes() []byte
func (*PhotoAsset) Delete ¶ added in v0.4.0
func (r *PhotoAsset) Delete() error
func (*PhotoAsset) Download ¶
func (r *PhotoAsset) Download(version PhotoVersion, livePhoto bool) (io.ReadCloser, error)
func (*PhotoAsset) DownloadTo ¶ added in v0.5.0
func (r *PhotoAsset) DownloadTo(version PhotoVersion, livePhoto bool, target string) error
func (*PhotoAsset) Filename ¶
func (r *PhotoAsset) Filename(livePhoto bool) string
func (*PhotoAsset) FormatSize ¶
func (r *PhotoAsset) FormatSize() string
func (*PhotoAsset) ID ¶
func (r *PhotoAsset) ID() string
func (*PhotoAsset) IsLivePhoto ¶ added in v0.21.1
func (r *PhotoAsset) IsLivePhoto() bool
func (*PhotoAsset) LocalPath ¶ added in v0.4.0
func (r *PhotoAsset) LocalPath(outputDir string, size PhotoVersion, fileStructure string, livePhoto bool) string
func (*PhotoAsset) OldOutputDir ¶ added in v0.21.1
func (r *PhotoAsset) OldOutputDir(output, folderStructure string) string
仅为兼容性
func (*PhotoAsset) OutputDir ¶ added in v0.10.0
func (r *PhotoAsset) OutputDir(output, folderStructure string) string
func (*PhotoAsset) Size ¶
func (r *PhotoAsset) Size() int
type PhotoService ¶
type PhotoService struct {
// contains filtered or unexported fields
}
func (*PhotoService) Albums ¶
func (r *PhotoService) Albums() (map[string]*PhotoAlbum, error)
func (*PhotoService) GetAlbum ¶ added in v0.4.0
func (r *PhotoService) GetAlbum(albumName string) (*PhotoAlbum, error)
func (*PhotoService) NewPhotoAssetFromBytes ¶ added in v0.9.0
func (r *PhotoService) NewPhotoAssetFromBytes(bs []byte) *PhotoAsset
type PhotoVersion ¶
type PhotoVersion string
const ( PhotoVersionOriginal PhotoVersion = "original" PhotoVersionMedium PhotoVersion = "medium" PhotoVersionThumb PhotoVersion = "thumb" )
type PhotosIterNext ¶
type PhotosIterNext interface { Next() (*PhotoAsset, error) Offset() int64 }
type SessionData ¶
type TextGetter ¶
type ValidateData ¶
type ValidateData struct { DsInfo *ValidateDataDsInfo `json:"dsInfo"` HasMinimumDeviceForPhotosWeb bool `json:"hasMinimumDeviceForPhotosWeb"` ICDPEnabled bool `json:"iCDPEnabled"` Webservices map[string]*webService `json:"webservices"` PcsEnabled bool `json:"pcsEnabled"` TermsUpdateNeeded bool `json:"termsUpdateNeeded"` ConfigBag struct { Urls struct { AccountCreateUI string `json:"accountCreateUI"` AccountLoginUI string `json:"accountLoginUI"` AccountLogin string `json:"accountLogin"` AccountRepairUI string `json:"accountRepairUI"` DownloadICloudTerms string `json:"downloadICloudTerms"` RepairDone string `json:"repairDone"` AccountAuthorizeUI string `json:"accountAuthorizeUI"` VettingUrlForEmail string `json:"vettingUrlForEmail"` AccountCreate string `json:"accountCreate"` GetICloudTerms string `json:"getICloudTerms"` VettingUrlForPhone string `json:"vettingUrlForPhone"` } `json:"urls"` AccountCreateEnabled bool `json:"accountCreateEnabled"` } `json:"configBag"` HsaTrustedBrowser bool `json:"hsaTrustedBrowser"` AppsOrder []string `json:"appsOrder"` Version int `json:"version"` IsExtendedLogin bool `json:"isExtendedLogin"` PcsServiceIdentitiesIncluded bool `json:"pcsServiceIdentitiesIncluded"` IsRepairNeeded bool `json:"isRepairNeeded"` HsaChallengeRequired bool `json:"hsaChallengeRequired"` RequestInfo struct { Country string `json:"country"` TimeZone string `json:"timeZone"` Region string `json:"region"` } `json:"requestInfo"` PcsDeleted bool `json:"pcsDeleted"` ICloudInfo struct { SafariBookmarksHasMigratedToCloudKit bool `json:"SafariBookmarksHasMigratedToCloudKit"` } `json:"iCloudInfo"` Apps map[string]*ValidateDataApp `json:"apps"` }
type ValidateDataApp ¶
type ValidateDataDsInfo ¶
type ValidateDataDsInfo struct { HsaVersion int `json:"hsaVersion"` LastName string `json:"lastName"` ICDPEnabled bool `json:"iCDPEnabled"` TantorMigrated bool `json:"tantorMigrated"` Dsid string `json:"dsid"` HsaEnabled bool `json:"hsaEnabled"` IsHideMyEmailSubscriptionActive bool `json:"isHideMyEmailSubscriptionActive"` IroncadeMigrated bool `json:"ironcadeMigrated"` Locale string `json:"locale"` BrZoneConsolidated bool `json:"brZoneConsolidated"` ICDRSCapableDeviceList string `json:"ICDRSCapableDeviceList"` IsManagedAppleID bool `json:"isManagedAppleID"` IsCustomDomainsFeatureAvailable bool `json:"isCustomDomainsFeatureAvailable"` IsHideMyEmailFeatureAvailable bool `json:"isHideMyEmailFeatureAvailable"` ContinueOnDeviceEligibleDeviceInfo []string `json:"ContinueOnDeviceEligibleDeviceInfo"` Gilligvited bool `json:"gilligvited"` AppleIdAliases []interface{} `json:"appleIdAliases"` UbiquityEOLEnabled bool `json:"ubiquityEOLEnabled"` IsPaidDeveloper bool `json:"isPaidDeveloper"` CountryCode string `json:"countryCode"` NotificationId string `json:"notificationId"` PrimaryEmailVerified bool `json:"primaryEmailVerified"` ADsID string `json:"aDsID"` Locked bool `json:"locked"` ICDRSCapableDeviceCount int `json:"ICDRSCapableDeviceCount"` HasICloudQualifyingDevice bool `json:"hasICloudQualifyingDevice"` PrimaryEmail string `json:"primaryEmail"` AppleIdEntries []struct { IsPrimary bool `json:"isPrimary"` Type string `json:"type"` Value string `json:"value"` } `json:"appleIdEntries"` GilliganEnabled bool `json:"gilligan-enabled"` IsWebAccessAllowed bool `json:"isWebAccessAllowed"` FullName string `json:"fullName"` MailFlags struct { IsThreadingAvailable bool `json:"isThreadingAvailable"` IsSearchV2Provisioned bool `json:"isSearchV2Provisioned"` SCKMail bool `json:"sCKMail"` IsMppSupportedInCurrentCountry bool `json:"isMppSupportedInCurrentCountry"` } `json:"mailFlags"` LanguageCode string `json:"languageCode"` AppleId string `json:"appleId"` HasUnreleasedOS bool `json:"hasUnreleasedOS"` AnalyticsOptInStatus bool `json:"analyticsOptInStatus"` FirstName string `json:"firstName"` ICloudAppleIdAlias string `json:"iCloudAppleIdAlias"` NotesMigrated bool `json:"notesMigrated"` BeneficiaryInfo struct { IsBeneficiary bool `json:"isBeneficiary"` } `json:"beneficiaryInfo"` HasPaymentInfo bool `json:"hasPaymentInfo"` PcsDelet bool `json:"pcsDelet"` AppleIdAlias string `json:"appleIdAlias"` BrMigrated bool `json:"brMigrated"` StatusCode int `json:"statusCode"` FamilyEligible bool `json:"familyEligible"` }
Source Files ¶
- auth.go
- auth_signin.go
- auth_trust_session.go
- auth_trusted_deviced.go
- auth_validate_code.go
- auth_validate_token.go
- auth_verify_2fa.go
- auth_with_credentials_service.go
- auth_with_token.go
- client.go
- close.go
- config.go
- drive_cli.go
- error.go
- photo_album.go
- photo_album_photos.go
- photo_album_photos_iter.go
- photo_album_size.go
- photo_asset.go
- photo_asset_delete.go
- photo_asset_download.go
- photo_asset_upload.go
- photo_cli.go
- photo_database.go
- photo_folder.go
- photo_folder_create.go
- photo_folders.go
- request.go
- type.go
- util.go
Click to show internal directories.
Click to hide internal directories.