file

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

https://pan.baidu.com/union/doc/9l4gmjcmj

Index

Constants

View Source
const (
	OndupFail      Ondup = "fail"
	OndupNewCopy         = "newcopy"
	OndupOverwrite       = "overwrite"
	OndupSkip            = "skip"

	AsyncSync Async = iota
	AsyncSelfAdaptation
	AsyncAsync

	OperaMove   Opera = "move"
	OperaCopy         = "copy"
	OperaDelete       = "delete"
	OperaRename       = "rename"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Async added in v0.5.1

type Async int32

type BatchGetFileInfoReq added in v0.5.1

type BatchGetFileInfoReq struct {
	Dlink int
	FSIds []uint64
}

func NewBatchGetFileListReq added in v0.5.1

func NewBatchGetFileListReq(fsid uint64) *BatchGetFileInfoReq

func (*BatchGetFileInfoReq) AppendFSID added in v0.5.1

func (r *BatchGetFileInfoReq) AppendFSID(fsid uint64) *BatchGetFileInfoReq
func (r *BatchGetFileInfoReq) GetDlink() string

func (*BatchGetFileInfoReq) GetFSIDString added in v0.5.1

func (r *BatchGetFileInfoReq) GetFSIDString() string

type BatchGetFileInfoRes added in v0.5.1

type BatchGetFileInfoRes struct {
	List []*bdpan.FileInfoDto `json:"list"`
}

func BatchGetFileInfo added in v0.5.1

func BatchGetFileInfo(accessToken string, req *BatchGetFileInfoReq) (*BatchGetFileInfoRes, error)

批量获取文件详情

type FileManager added in v0.5.1

type FileManager struct {
	Path    string `json:"path,omitempty"`
	Newname string `json:"newname,omitempty"`
	Dest    string `json:"dest,omitempty"`
	Ondup   string `json:"ondup,omitempty"`
}

func NewFileManager added in v0.5.1

func NewFileManager(path, dest, newname string) *FileManager

type FileManagerInfo added in v0.5.1

type FileManagerInfo struct {
	Errno int    `json:"errno,omitempty"`
	Path  string `json:"path,omitempty"`
}

type GetFileInfoReq added in v0.5.1

type GetFileInfoReq struct {
	Dlink int
	FSID  uint64
}

func NewGetFileInfoReq added in v0.5.1

func NewGetFileInfoReq(fsid uint64) *GetFileInfoReq

type GetFileInfoRes added in v0.5.1

type GetFileInfoRes struct {
	bdpan.FileInfoDto
}

func GetFileInfo added in v0.5.1

func GetFileInfo(accessToken string, req *GetFileInfoReq) (*GetFileInfoRes, error)

获取文件详情 https://pan.baidu.com/union/doc/Fksg0sbcm

type GetFileListReq

type GetFileListReq struct {
	Dir string
	Web int

	Start int
	Limit int32
	// 排序字段:默认为name;
	// time表示先按文件类型排序,后按修改时间排序;
	// name表示先按文件类型排序,后按文件名称排序;
	// size表示先按文件类型排序,后按文件大小排序。
	Order string
	// 默认为升序,设置为1实现降序 (注:排序的对象是当前目录下所有文件,不是当前分页下的文件)
	Desc int32
	// contains filtered or unexported fields
}

func NewGetFileListReq

func NewGetFileListReq() *GetFileListReq

func (*GetFileListReq) SetDir added in v0.5.1

func (r *GetFileListReq) SetDir(dir string) *GetFileListReq

func (*GetFileListReq) SetLimit added in v0.5.1

func (r *GetFileListReq) SetLimit(limit int32) *GetFileListReq

func (*GetFileListReq) SetPage added in v0.5.1

func (r *GetFileListReq) SetPage(page int) *GetFileListReq

type GetFileListRes

type GetFileListRes struct {
	GuidInfo string               `json:"guid_info"`
	Errmsg   string               `json:"errmsg"`
	List     []*bdpan.FileInfoDto `json:"list"`
}

func GetFileList

func GetFileList(accessToken string, req *GetFileListReq) (*GetFileListRes, error)

获取文件列表

type ManageFileReq added in v0.5.1

type ManageFileReq struct {
	Filelist []*FileManager
	// 0 同步,1 自适应,2 异步
	Async Async
	// 全局ondup,遇到重复文件的处理策略,
	// fail(默认,直接返回失败)、newcopy(重命名文件)、overwrite、skip
	Ondup Ondup
	// 文件操作参数,可实现文件复制、移动、重命名、删除,依次对应的参数值为:copy、move、rename、delete
	Opera Opera
}

https://pan.baidu.com/union/doc/mksg0s9l4?from=open-sdk-go

func NewManageFileReq added in v0.5.1

func NewManageFileReq(
	opera Opera,
	filelist []*FileManager,
) *ManageFileReq

func (ManageFileReq) GetFilelistString added in v0.5.1

func (r ManageFileReq) GetFilelistString() string

type ManageFileRes added in v0.5.1

type ManageFileRes struct {
	Info      []FileManagerInfo `json:"info,omitempty"`
	RequestId int64             `json:"request_id,omitempty"`
	Taskid    int64             `json:"taskid,omitempty"`
}

func DeleteFile added in v0.5.1

func DeleteFile(accessToken string, path string) (*ManageFileRes, error)

func DeleteFiles added in v0.5.1

func DeleteFiles(accessToken string, paths []string) (*ManageFileRes, error)

删除文件列表

func ManageFile added in v0.5.1

func ManageFile(accessToken string, req *ManageFileReq) (*ManageFileRes, error)

type Ondup added in v0.5.1

type Ondup string

type Opera added in v0.5.1

type Opera string

type SearchFileReq added in v0.5.1

type SearchFileReq struct {
	Dir       string
	Key       string
	Recursion int
}

func NewSearchFileReq added in v0.5.1

func NewSearchFileReq(path string) *SearchFileReq

type SearchFileRes added in v0.5.1

type SearchFileRes struct {
	HasMore int                  `json:"has_more"`
	List    []*bdpan.FileInfoDto `json:"list"`
}

func SearchFile added in v0.5.1

func SearchFile(accessToken string, req *SearchFileReq) (*SearchFileRes, error)

搜索文件

Jump to

Keyboard shortcuts

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