aliyundrive

package
v1.5.14 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TYPE_FILE   = "file"
	TYPE_FOLDER = "folder"
)

Variables

This section is empty.

Functions

func Batch

func Batch(requests []batchRequest, token Token) error

func Delete

func Delete(files []File, token Token) error

func Download

func Download(file File, parallel int, dir string, token Token) error

func Move

func Move(tofileid string, files []File, token Token) error

func Rename

func Rename(name, fileid string, token Token) error

func ShareCancel

func ShareCancel(shareidlist []string, token Token) error

func Trash

func Trash(files []File, token Token) error

func UploadFile

func UploadFile(path, fileid string, token Token) (id string, err error)

func UploadImage

func UploadImage(path string, token Token) error

Types

type DownloadUrl

type DownloadUrl struct {
	Url         string    `json:"url"`
	InternalUrl string    `json:"internal_url"`
	Expiration  time.Time `json:"expiration"`
	Size        int       `json:"size"`
	ContentHash string    `json:"content_hash"`
}

func GetDownloadUrl

func GetDownloadUrl(file File, token Token) (du DownloadUrl, err error)

type File

type File struct {
	DriveID     string `json:"drive_id"`
	DomainID    string `json:"domain_id"`
	EncryptMode string `json:"encrypt_mode"`
	FileID      string `json:"file_id"`
	ParentID    string `json:"parent_file_id"`
	Type        string `json:"type"`
	Name        string `json:"name"`

	Size      int    `json:"size"`
	Category  string `json:"category"`
	Hash      string `json:"content_hash"`
	HashName  string `json:"content_hash_name"`
	Url       string `json:"download_url"`
	Thumbnail string `json:"thumbnail"`
	Extension string `json:"file_extension"`
}

func FileInfo

func FileInfo(fileid string, token Token) (file File, err error)

func Files

func Files(parentFileID string, token Token) (list []File, err error)
func Search(fileid string, token Token) (list []File, err error)

type ShareInfo

type ShareInfo struct {
	ShareID    string   `json:"share_id"`
	ShareName  string   `json:"share_name"`
	ShareUrl   string   `json:"share_url"`
	Expiration string   `json:"expiration"`
	Status     string   `json:"status"`
	FileIDList []string `json:"file_id_list"`
}

func Share

func Share(fileidlist []string, token Token) (share ShareInfo, err error)

func ShareList

func ShareList(token Token) (list []ShareInfo, err error)

type State added in v1.5.8

type State struct {
	// contains filtered or unexported fields
}

type Token

type Token struct {
	SboxDriveID  string `json:"default_sbox_drive_id"`
	DeviceID     string `json:"device_id"`
	DriveID      string `json:"default_drive_id"`
	UserID       string `json:"user_id"`
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

func Refresh

func Refresh(refresh string) (token Token, err error)

type UploadFolderInfo

type UploadFolderInfo struct {
	DeviceID     string `json:"device_id"`
	DomainID     string `json:"domain_id"`
	FileID       string `json:"file_id"`
	ParentID     string `json:"parent_file_id"`
	Type         string `json:"type"`
	Name         string `json:"file_name"`
	UploadID     string `json:"upload_id"`
	RapidUpload  bool   `json:"rapid_upload"`
	PartInfoList []struct {
		InternalUploadUrl string `json:"internal_upload_url"`
		PartNumber        int    `json:"part_number"`
		UploadUrl         string `json:"upload_url"`
	} `json:"part_info_list"`
}

func Create

func Create(checkmode, name, filetype, fileid string, token Token, appendargs map[string]interface{}, path ...string) (
	upload UploadFolderInfo, err error)

func CreateDirectory

func CreateDirectory(name, fileid string, token Token) (upload UploadFolderInfo, err error)

func CreateWithFolder

func CreateWithFolder(checkmode, name, filetype, fileid string, token Token, args map[string]interface{}, path ...string) (
	upload UploadFolderInfo, err error)

Jump to

Keyboard shortcuts

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