Documentation ¶
Index ¶
- Constants
- Variables
- func CreateDestination() (string, int64, error)
- type SixFile
- type SixOfflineTask
- type SixOfflineTaskStatus
- type SixUploadToken
- type SixUser
- func (user *SixUser) AddOfflineTask(hash, path string) error
- func (user *SixUser) CopyFile(source, target string) error
- func (user *SixUser) CreateDirectory(path string) error
- func (user *SixUser) CreateUploadToken(path, name, hash string) SixUploadToken
- func (user *SixUser) CreateUploadTree(remote string, files []string) map[string]string
- func (user *SixUser) DeleteFile(path string) error
- func (user *SixUser) GetDownloadAddressByPath(path string) (string, error)
- func (user *SixUser) GetFileByPath(path string) (*SixFile, error)
- func (user *SixUser) GetFilesByPath(path string) ([]*SixFile, error)
- func (user *SixUser) GetOfflineTasks() ([]*SixOfflineTask, error)
- func (user *SixUser) GetRootFile() *SixFile
- func (user *SixUser) PreparseOffline(url, pass string) (string, string, int64, error)
- func (user *SixUser) RefreshUserInfo()
- func (user *SixUser) SearchFilesByName(parent, name string) ([]*SixFile, error)
Constants ¶
View Source
const ( Failed SixOfflineTaskStatus = -1 Downloaded = 1000 Downloading = 100 AlmostDownloaded = 900 )
Variables ¶
View Source
var ( ErrWaitingLogin = errors.New("waiting for login") ErrStateWrong = errors.New("state wrong") ErrCreateDestFailed = errors.New("create destination failed") ErrDestExpired = errors.New("destination expired") ErrLoginFailed = errors.New("login failed") ErrInvalidToken = errors.New("invalid token") )
Functions ¶
func CreateDestination ¶
Types ¶
type SixFile ¶
type SixFile struct { Identity string `json:"identity"` ETag string `json:"hash"` UserIdentity int64 `json:"userIdentity"` Path string `json:"path"` Name string `json:"name"` Size int64 `json:"size"` CreateTime int64 `json:"ctime"` Mime string `json:"mime"` ParentIdentity string `json:"parent"` IsDir bool `json:"directory"` // contains filtered or unexported fields }
func (*SixFile) GetChildren ¶
func (*SixFile) GetDownloadAddress ¶
type SixOfflineTask ¶
type SixOfflineTask struct { Identity string `json:"identity"` UserIdentity int64 `json:"userIdentity"` CreateTime int64 `json:"createTime"` Name string `json:"name"` Type int32 `json:"type"` Status SixOfflineTaskStatus `json:"status"` TotalSize int64 `json:"size"` DownloadedSize int64 `json:"downloadSize"` Progress int32 `json:"progress"` AccessPath string `json:"accessPath"` ErrorCode int32 `json:"errorCode"` ErrorMessage string `json:"errorMessage"` }
func (SixOfflineTask) StatusStr ¶
func (task SixOfflineTask) StatusStr() string
type SixOfflineTaskStatus ¶
type SixOfflineTaskStatus int
type SixUploadToken ¶
type SixUser ¶
type SixUser struct { Username string Identity int64 UsedSpace int64 TotalSpace int64 Client *models.SixHttpClient }
func LoginWithAccessToken ¶
func LoginWithWebToken ¶
func (*SixUser) AddOfflineTask ¶
func (*SixUser) CreateDirectory ¶
func (*SixUser) CreateUploadToken ¶
func (user *SixUser) CreateUploadToken(path, name, hash string) SixUploadToken
func (*SixUser) CreateUploadTree ¶
func (*SixUser) DeleteFile ¶
func (*SixUser) GetDownloadAddressByPath ¶
func (*SixUser) GetFilesByPath ¶
func (*SixUser) GetOfflineTasks ¶
func (user *SixUser) GetOfflineTasks() ([]*SixOfflineTask, error)
func (*SixUser) GetRootFile ¶
func (*SixUser) PreparseOffline ¶
func (*SixUser) RefreshUserInfo ¶
func (user *SixUser) RefreshUserInfo()
Click to show internal directories.
Click to hide internal directories.