Documentation
¶
Index ¶
- Variables
- func Config(ctx context.Context, name string, m configmap.Mapper, config fs.ConfigIn) (*fs.ConfigOut, error)
- func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, error)
- func SplitPath(pathStr string) (dir, file string)
- type BaiduClient
- func (b *BaiduClient) AddParam(opts *rest.Opts) *rest.Opts
- func (b *BaiduClient) Call(ctx context.Context, opts *rest.Opts) (*http.Response, error)
- func (b *BaiduClient) CallJSON(ctx context.Context, opts *rest.Opts, request interface{}, ...) (*http.Response, error)
- func (b *BaiduClient) CallJSONBase(ctx context.Context, opts *rest.Opts, request interface{}, ...) (*http.Response, error)
- func (b *BaiduClient) CallJSONIgnore(ctx context.Context, opts *rest.Opts, request interface{}, ...) (*http.Response, error)
- type Dir
- func (d *Dir) Fs() fs.Info
- func (d *Dir) ID() string
- func (d *Dir) Items() int64
- func (d *Dir) ModTime(ctx context.Context) time.Time
- func (d *Dir) ParentID() string
- func (d *Dir) Remote() string
- func (d *Dir) SetID(id string) *Dir
- func (d *Dir) SetItems(items int64) *Dir
- func (d *Dir) SetParentID(parent string) *Dir
- func (d *Dir) SetRemote(remote string) *Dir
- func (d *Dir) SetSize(size int64) *Dir
- func (d *Dir) Size() int64
- func (d *Dir) String() string
- type ErrnoResponse
- type Fs
- func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error)
- func (f *Fs) Create(ctx context.Context, path string, preCreateFileData *api.PreCreateFileData, ...) (info *api.CreateVO, err error)
- func (f *Fs) CreateDir(ctx context.Context, pathID, leaf string) (newID string, err error)
- func (f *Fs) CreateDirForce(ctx context.Context, path string) (err error)
- func (f *Fs) DeleteDirOrFile(ctx context.Context, filePath string) (err error)
- func (f *Fs) DeleteDirsOrFiles(ctx context.Context, fileList []string) (err error)
- func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string) error
- func (f *Fs) DownFile(ctx context.Context, path string, size int64, options []fs.OpenOption) (in io.ReadCloser, err error)
- func (f *Fs) DownFileBySlice(ctx context.Context, downUrl string, beginIndex int64, endIndex int64) (resp *http.Response, err error)
- func (f *Fs) DownFileDisguiseBaiduClient(ctx context.Context, path string, options []fs.OpenOption) (resp *http.Response, err error)
- func (f *Fs) DownFileSe(ctx context.Context, path string, size int64, options []fs.OpenOption) (in io.ReadCloser, err error)
- func (f *Fs) DownFileSerial(ctx context.Context, path string, size int64, options []fs.OpenOption) (in io.ReadCloser, err error)
- func (f *Fs) Features() *fs.Features
- func (f *Fs) FindLeaf(ctx context.Context, pathID, leaf string) (pathIDOut string, found bool, err error)
- func (f *Fs) GetDownUrl(ctx context.Context, path string) (url string, err error)
- func (f *Fs) GetFileMeta(ctx context.Context, path string, needDownLink bool, needTextLink bool) (item *api.Item, resp *http.Response, err error)
- func (f *Fs) GetFileMetas(ctx context.Context, path []string, needDownLink bool, needTextLink bool) (itemList []*api.Item, resp *http.Response, err error)
- func (f *Fs) GetTemplateVariable(ctx context.Context) (*api.TemplateInfo, error)
- func (f *Fs) Hashes() hash.Set
- func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error)
- func (f *Fs) ListDirAllFiles(ctx context.Context, path string) (itemList []*api.Item, err error)
- func (f *Fs) ListDirFilesPage(ctx context.Context, path string, page int, num int) (itemList []*api.Item, resp *http.Response, err error)
- func (f *Fs) Mkdir(ctx context.Context, dir string) error
- func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, error)
- func (f *Fs) MoveOrCopyDirOrFile(ctx context.Context, fileParamList api.FileManagerParam, operate api.Operate) (err error)
- func (f *Fs) MoveOrCopyDirsOrFiles(ctx context.Context, fileParamList []api.FileManagerParam, operate api.Operate) (err error)
- func (f *Fs) Name() string
- func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error)
- func (f *Fs) NewObjectFromBaseItem(item *api.BaseItem) (*Object, error)
- func (f *Fs) PreCreate(ctx context.Context, reader *readers.RepeatableReader, localCtime int64, ...) (preCreateFileData *api.PreCreateFileData, info *api.PreCreateVO, err error)
- func (f *Fs) Precision() time.Duration
- func (f *Fs) Purge(ctx context.Context, dir string) error
- func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
- func (f *Fs) RenameDirOrFile(ctx context.Context, fileParamList api.FileManagerParam) (err error)
- func (f *Fs) RenameDirsOrFiles(ctx context.Context, fileParamList []api.FileManagerParam) (err error)
- func (f *Fs) Rmdir(ctx context.Context, dir string) error
- func (f *Fs) Root() string
- func (f *Fs) String() string
- func (f *Fs) ToAbsoluteFilePath(relativePath string, fileName string) string
- func (f *Fs) ToAbsolutePath(relativePath string) string
- func (f *Fs) ToAbsolutePathFromNative(relativePath string) string
- func (f *Fs) ToAbsolutePathFromStandard(relativePath string) string
- func (f *Fs) ToRelativeFilePath(relativePath string, fileName string) string
- func (f *Fs) ToRelativePath(absolutePath string) (string, error)
- func (f *Fs) UploadFile(ctx context.Context, in io.Reader, localCtime int64, localMtime int64, ...) (*api.BaseItem, error)
- type Object
- func (o *Object) Fs() fs.Info
- func (o *Object) Hash(ctx context.Context, t hash.Type) (string, error)
- func (o *Object) ID() string
- func (o *Object) MimeType(ctx context.Context) string
- func (o *Object) ModTime(ctx context.Context) time.Time
- func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error)
- func (o *Object) OpenOld(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error)
- func (o *Object) Remote() string
- func (o *Object) Remove(ctx context.Context) error
- func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error
- func (o *Object) Size() int64
- func (o *Object) Storable() bool
- func (o *Object) String() string
- func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error)
- type Options
- type TaskResult
Constants ¶
This section is empty.
Variables ¶
var ( // QuickXorHashType is the hash.Type for OneDrive QuickXorHashType hash.Type )
Globals
Functions ¶
Types ¶
type BaiduClient ¶
type BaiduClient struct { *rest.Client Channel string Web string AppId string Bdstoken string LogId string ClientType string DpLogId string // contains filtered or unexported fields }
func NewBaiduClient ¶
func NewBaiduClient(client *rest.Client, logId string) *BaiduClient
func (*BaiduClient) CallJSON ¶
func (b *BaiduClient) CallJSON(ctx context.Context, opts *rest.Opts, request interface{}, response ErrnoResponse) (*http.Response, error)
func (*BaiduClient) CallJSONBase ¶
func (*BaiduClient) CallJSONIgnore ¶
func (b *BaiduClient) CallJSONIgnore(ctx context.Context, opts *rest.Opts, request interface{}, response ErrnoResponse, ignoreList []int) (*http.Response, error)
type Dir ¶
type Dir struct {
// contains filtered or unexported fields
}
Dir describes an unspecialized directory for directory/container/bucket lists
func NewDir ¶
NewDir creates an unspecialized Directory object
If the modTime is unknown pass in time.Time{}
func (*Dir) Items ¶
Items returns the count of items in this directory or this directory and subdirectories if known, -1 for unknown
func (*Dir) ModTime ¶
ModTime returns the modification date of the file
If one isn't available it returns the configured --default-dir-time
func (*Dir) SetParentID ¶
SetParentID sets the optional parent ID of the Dir
type ErrnoResponse ¶
type ErrnoResponse interface {
GetErrno() int
}
type Fs ¶
type Fs struct { UserId int64 // ID to use for querying Microsoft Graph VipType string // https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/drive // contains filtered or unexported fields }
Fs represents a remote OneDrive
func (*Fs) Copy ¶
Copy src to this remote using server-side copy operations.
This is stored with the remote path given.
It returns the destination Object and a possible error.
Will only be called if src.Fs().Name() == f.Name()
If it isn't possible then return fs.ErrorCantCopy
func (*Fs) Create ¶
func (f *Fs) Create(ctx context.Context, path string, preCreateFileData *api.PreCreateFileData, uploadId string) (info *api.CreateVO, err error)
Create {"ctime":1713679787,"from_type":1,"fs_id":908199638643457,"isdir":0,"md5":"cd46789bbnf14a0f4de795dd13a70ca3","mtime":1713679787,"path":"/test/999/111/8e3dc4f3a75d1e13f428a1dd15e57fb7.png","size":30051726,"errno":0,"name":"\/test\/999\/111\/8e3dc4f3a75d1e13f428a1dd15e57fb7.png","category":3}
func (*Fs) CreateDirForce ¶
CreateDirForce force to create file ,if exists , not do anything
func (*Fs) DeleteDirOrFile ¶
func (*Fs) DeleteDirsOrFiles ¶
func (*Fs) DirMove ¶
DirMove moves src, srcRemote to this remote at dstRemote using server-side move operations.
Will only be called if src.Fs().Name() == f.Name()
If it isn't possible then return fs.ErrorCantDirMove
If destination exists then return fs.ErrorDirExists ¶
srcRemote is absolute path,dstRemote is absolute path,can not end with "/"
func (*Fs) DownFile ¶
func (f *Fs) DownFile(ctx context.Context, path string, size int64, options []fs.OpenOption) (in io.ReadCloser, err error)
有多少切片就开多少线程去下载
func (*Fs) DownFileBySlice ¶
func (f *Fs) DownFileBySlice(ctx context.Context, downUrl string, beginIndex int64, endIndex int64) (resp *http.Response, err error)
DownFileBySlice 手机app设定的分片值为32768,或许可以设置更大一些,需要测试
func (*Fs) DownFileDisguiseBaiduClient ¶
func (*Fs) DownFileSe ¶
func (f *Fs) DownFileSe(ctx context.Context, path string, size int64, options []fs.OpenOption) (in io.ReadCloser, err error)
固定线程去下载
func (*Fs) DownFileSerial ¶
func (f *Fs) DownFileSerial(ctx context.Context, path string, size int64, options []fs.OpenOption) (in io.ReadCloser, err error)
串行执行
func (*Fs) GetDownUrl ¶
func (*Fs) GetFileMeta ¶
func (f *Fs) GetFileMeta(ctx context.Context, path string, needDownLink bool, needTextLink bool) (item *api.Item, resp *http.Response, err error)
GetFileMeta 返回单个文件或文件夹信息,经过处理
func (*Fs) GetFileMetas ¶
func (f *Fs) GetFileMetas(ctx context.Context, path []string, needDownLink bool, needTextLink bool) (itemList []*api.Item, resp *http.Response, err error)
GetFileMetas 返回多个文件或文件夹信息(注意是path只能一一对应,并且无法获取到时不会报错,而是返回的info里没有对应的文件或文件夹时errno为-9,外层为0)
func (*Fs) GetTemplateVariable ¶
func (*Fs) List ¶
List entries normal need to implement fs.Directory or fs.Object ,dir is relative path.
func (*Fs) ListDirAllFiles ¶
func (*Fs) ListDirFilesPage ¶
func (*Fs) Move ¶
Move src to this remote using server-side move operations.
This is stored with the remote path given.
It returns the destination Object and a possible error.
Will only be called if src.Fs().Name() == f.Name()
If it isn't possible then return fs.ErrorCantMove
func (*Fs) MoveOrCopyDirOrFile ¶
func (*Fs) MoveOrCopyDirsOrFiles ¶
func (*Fs) NewObject ¶
NewObject finds the Object at remote. If it can't be found it returns the error fs.ErrorObjectNotFound.
func (*Fs) NewObjectFromBaseItem ¶
func (*Fs) PreCreate ¶
func (f *Fs) PreCreate(ctx context.Context, reader *readers.RepeatableReader, localCtime int64, localMtime int64, size int64, path string) (preCreateFileData *api.PreCreateFileData, info *api.PreCreateVO, err error)
PreCreate {"path":"/test/999/111/1234.exe","return_type":1,"block_list":["5910a591dd8fc18c32a8f3df4fdc1761","a5fc157d78e6ad1c7e114b056c92821e"],"errno":0,"request_id":278285463311322051} { "return_type": 2, "errno": 0, "info": { "md5": "5ddc05b01g7f6ae7d6adc90d912c983d", "category": 6, "fs_id": 166064416325948, "request_id": 280244028406040000, "from_type": 1, "size": 112060240, "isdir": 0, "mtime": 1713672326, "ctime": 1713672326, "path": "/test/999/111/1234_20240421_120525.exe" }, "request_id": 280244028406040573 } return_type 1 无法秒传,准备上传 2 秒传成功 3 文件已存在(仅一刻相册,在百度网盘中只会返回2) 文件名中不能包含?|"><:*等特殊字符
func (*Fs) Put ¶
func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
Put in to the remote path with the modTime given of the given size
When called from outside an Fs by rclone, src.Size() will always be >= 0. But for unknown-sized objects (indicated by src.Size() == -1), Put should either return an error or upload it properly (rather than e.g. calling panic).
May create the object even if it returns an error - if so will return the object and the error, otherwise will return nil and the error
func (*Fs) RenameDirOrFile ¶
func (*Fs) RenameDirsOrFiles ¶
func (*Fs) ToAbsoluteFilePath ¶
func (*Fs) ToAbsolutePath ¶
func (*Fs) ToAbsolutePathFromNative ¶
func (*Fs) ToAbsolutePathFromStandard ¶
func (*Fs) ToRelativeFilePath ¶
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
Object describes a OneDrive object
Will definitely have info but maybe not meta
func (*Object) ModTime ¶
ModTime returns the modification time of the object
It attempts to read the objects mtime and if that isn't present the LastModified returned in the http headers
func (*Object) Open ¶
func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error)
func (*Object) OpenOld ¶
func (o *Object) OpenOld(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error)
Open an object for read
func (*Object) SetModTime ¶
SetModTime sets the modification time of the local fs object
type Options ¶
type Options struct { Region string `config:"region"` ChunkSize fs.SizeSuffix `config:"chunk_size"` UserID int64 `config:"drive_id"` VipType string `config:"drive_type"` RootFolderID string `config:"root_folder_id"` DisableSitePermission bool `config:"disable_site_permission"` AccessScopes fs.SpaceSepList `config:"access_scopes"` ExposeOneNoteFiles bool `config:"expose_onenote_files"` ServerSideAcrossConfigs bool `config:"server_side_across_configs"` ListChunk int64 `config:"list_chunk"` NoVersions bool `config:"no_versions"` LinkScope string `config:"link_scope"` LinkType string `config:"link_type"` LinkPassword string `config:"link_password"` HashType string `config:"hash_type"` AVOverride bool `config:"av_override"` Delta bool `config:"delta"` Enc encoder.MultiEncoder `config:"encoding"` }
Options defines the configuration for this backend
type TaskResult ¶
type TaskResult struct {
// contains filtered or unexported fields
}
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package quickxorhash provides the quickXorHash algorithm which is a quick, simple non-cryptographic hash algorithm that works by XORing the bytes in a circular-shifting fashion.
|
Package quickxorhash provides the quickXorHash algorithm which is a quick, simple non-cryptographic hash algorithm that works by XORing the bytes in a circular-shifting fashion. |