six_cloud

package
v0.0.7-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

func CreateDestination() (string, int64, error)

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"`
	Shared         bool   `json:"share"`
	// contains filtered or unexported fields
}

func (*SixFile) GetChildren

func (file *SixFile) GetChildren() []*SixFile

func (*SixFile) GetDownloadAddress

func (file *SixFile) GetDownloadAddress() (string, error)

func (*SixFile) GetLocalTree

func (file *SixFile) GetLocalTree(localPath string) map[string]*SixFile

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 SixUploadToken struct {
	UploadToken string
	UploadUrl   string
	Cached      bool
}

type SixUser

type SixUser struct {
	Username   string
	Identity   int64
	UsedSpace  int64
	TotalSpace int64

	Client *models.SixHttpClient
}

func LoginWithAccessToken

func LoginWithAccessToken(token string) (*SixUser, error)

func LoginWithUsernameOrPhone

func LoginWithUsernameOrPhone(value, password string) (*SixUser, error)

func LoginWithWebToken

func LoginWithWebToken(dest, state string) (*SixUser, error)

func (*SixUser) AddOfflineTask

func (user *SixUser) AddOfflineTask(hash, path string) error

func (*SixUser) CopyFile

func (user *SixUser) CopyFile(source, target string) error

func (*SixUser) CreateDirectory

func (user *SixUser) CreateDirectory(path string) error

func (*SixUser) CreateUploadToken

func (user *SixUser) CreateUploadToken(path, name, hash string) SixUploadToken

func (*SixUser) CreateUploadTree

func (user *SixUser) CreateUploadTree(remote string, files []string) map[string]string

func (*SixUser) DeleteFile

func (user *SixUser) DeleteFile(path string) error

func (*SixUser) GetDownloadAddressByPath

func (user *SixUser) GetDownloadAddressByPath(path string) (string, error)

func (*SixUser) GetFileByPath

func (user *SixUser) GetFileByPath(path string) (*SixFile, error)

func (*SixUser) GetFilesByPath

func (user *SixUser) GetFilesByPath(path string) ([]*SixFile, error)

func (*SixUser) GetOfflineTasks

func (user *SixUser) GetOfflineTasks() ([]*SixOfflineTask, error)

func (*SixUser) GetRootFile

func (user *SixUser) GetRootFile() *SixFile

func (*SixUser) PreparseOffline

func (user *SixUser) PreparseOffline(url, pass string) (string, string, int64, error)

func (*SixUser) RefreshUserInfo

func (user *SixUser) RefreshUserInfo()

func (*SixUser) SearchFilesByName

func (user *SixUser) SearchFilesByName(parent, name string) ([]*SixFile, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL