aliyundrive_open

package
v4.2.9 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: AGPL-3.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var API_URL = "https://openapi.alipan.com"

Functions

This section is empty.

Types

type Addition

type Addition struct {
	DriveType string `json:"drive_type" type:"select" options:"default,resource,backup" default:"resource"`
	driver.RootID
	RefreshToken        string `json:"refresh_token" required:"true"`
	OrderBy             string `json:"order_by" type:"select" options:"name,size,updated_at,created_at"`
	OrderDirection      string `json:"order_direction" type:"select" options:"ASC,DESC"`
	UseOnlineAPI        bool   `json:"use_online_api" default:"true"`
	AlipanType          string `json:"alipan_type" required:"true" type:"select" default:"default" options:"default,alipanTV"`
	APIAddress          string `json:"api_url_address" default:"https://api.oplist.org/alicloud/renewapi"`
	ClientID            string `json:"client_id" help:"Keep it empty if you don't have one"`
	ClientSecret        string `json:"client_secret" help:"Keep it empty if you don't have one"`
	RemoveWay           string `json:"remove_way" required:"true" type:"select" options:"trash,delete"`
	RapidUpload         bool   `` /* 134-byte string literal not displayed */
	InternalUpload      bool   `json:"internal_upload" help:"If you are using Aliyun ECS is located in Beijing, you can turn it on to boost the upload speed"`
	LIVPDownloadFormat  string `json:"livp_download_format" type:"select" options:"jpeg,mov" default:"jpeg"`
	CallbackConcurrency int    `json:"callback_concurrency" type:"number" default:"1" help:"Maximum active proxied downloads shared by Aliyun user"`
	AccessToken         string
}

type AliyundriveOpen

type AliyundriveOpen struct {
	model.Storage
	Addition

	DriveId string
	// contains filtered or unexported fields
}

func (*AliyundriveOpen) Config

func (d *AliyundriveOpen) Config() driver.Config

func (*AliyundriveOpen) Copy

func (d *AliyundriveOpen) Copy(ctx context.Context, srcObj, dstDir model.Obj) error

func (*AliyundriveOpen) Drop

func (d *AliyundriveOpen) Drop(ctx context.Context) error

func (*AliyundriveOpen) GetAddition

func (d *AliyundriveOpen) GetAddition() driver.Additional

func (*AliyundriveOpen) GetDetails added in v4.1.4

func (d *AliyundriveOpen) GetDetails(ctx context.Context) (*model.StorageDetails, error)

func (*AliyundriveOpen) GetRoot

func (d *AliyundriveOpen) GetRoot(ctx context.Context) (model.Obj, error)

GetRoot implements the driver.GetRooter interface to properly set up the root object

func (*AliyundriveOpen) Init

func (d *AliyundriveOpen) Init(ctx context.Context) error

func (*AliyundriveOpen) InitReference

func (d *AliyundriveOpen) InitReference(storage driver.Driver) error
func (d *AliyundriveOpen) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)

func (*AliyundriveOpen) List

func (d *AliyundriveOpen) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)

func (*AliyundriveOpen) MakeDir

func (d *AliyundriveOpen) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error)

func (*AliyundriveOpen) Move

func (d *AliyundriveOpen) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)

func (*AliyundriveOpen) Other

func (d *AliyundriveOpen) Other(ctx context.Context, args model.OtherArgs) (interface{}, error)

func (*AliyundriveOpen) Put

func (*AliyundriveOpen) RapidHashAlgos added in v4.2.8

func (d *AliyundriveOpen) RapidHashAlgos() []utils.HashType

RapidHashAlgos 返回阿里云盘支持的秒传哈希算法(SHA1)

func (*AliyundriveOpen) RapidHashNeedsPieces added in v4.2.8

func (d *AliyundriveOpen) RapidHashNeedsPieces() bool

RapidHashNeedsPieces 阿里云盘不需要分片哈希

func (*AliyundriveOpen) RapidUploadByHashes added in v4.2.8

func (d *AliyundriveOpen) RapidUploadByHashes(ctx context.Context, dstDir model.Obj, req *driver.SeedRapidUploadRequest, overwrite bool) (model.Obj, error)

RapidUploadByHashes 使用种子中的 SHA1 哈希尝试秒传。

阿里云盘的秒传还需要 proof_code(按 proof range 读取的一段内容), 因此当内容源不可用时无法完成秒传。

func (*AliyundriveOpen) Remove

func (d *AliyundriveOpen) Remove(ctx context.Context, obj model.Obj) error

func (*AliyundriveOpen) Rename

func (d *AliyundriveOpen) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error)

type CreateResp

type CreateResp struct {
	//Type         string `json:"type"`
	//ParentFileId string `json:"parent_file_id"`
	//DriveId      string `json:"drive_id"`
	FileId string `json:"file_id"`
	//RevisionId   string `json:"revision_id"`
	//EncryptMode  string `json:"encrypt_mode"`
	//DomainId     string `json:"domain_id"`
	//FileName     string `json:"file_name"`
	UploadId string `json:"upload_id"`
	//Location     string `json:"location"`
	RapidUpload  bool       `json:"rapid_upload"`
	PartInfoList []PartInfo `json:"part_info_list"`
}

type ErrResp

type ErrResp struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type File

type File struct {
	DriveId       string    `json:"drive_id"`
	FileId        string    `json:"file_id"`
	ParentFileId  string    `json:"parent_file_id"`
	Name          string    `json:"name"`
	Size          int64     `json:"size"`
	FileExtension string    `json:"file_extension"`
	ContentHash   string    `json:"content_hash"`
	Category      string    `json:"category"`
	Type          string    `json:"type"`
	Thumbnail     string    `json:"thumbnail"`
	Url           string    `json:"url"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`

	// create only
	FileName string `json:"file_name"`
}

type Files

type Files struct {
	Items      []File `json:"items"`
	NextMarker string `json:"next_marker"`
}

type MoveOrCopyResp

type MoveOrCopyResp struct {
	Exist   bool   `json:"exist"`
	DriveID string `json:"drive_id"`
	FileID  string `json:"file_id"`
}

type PartInfo

type PartInfo struct {
	Etag        interface{} `json:"etag"`
	PartNumber  int         `json:"part_number"`
	PartSize    interface{} `json:"part_size"`
	UploadUrl   string      `json:"upload_url"`
	ContentType string      `json:"content_type"`
}

type ProofRange

type ProofRange struct {
	Start int64
	End   int64
}

Jump to

Keyboard shortcuts

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