Documentation ¶
Overview ¶
Package union implements a virtual provider to join existing remotes.
Index ¶
- func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, error)
- type Directory
- type Errors
- type Fs
- func (f *Fs) About(ctx context.Context) (*fs.Usage, error)
- func (f *Fs) ChangeNotify(ctx context.Context, fn func(string, fs.EntryType), ch <-chan time.Duration)
- func (f *Fs) CleanUp(ctx context.Context) error
- func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error)
- func (f *Fs) DirCacheFlush()
- func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string) error
- func (f *Fs) Features() *fs.Features
- func (f *Fs) Hashes() hash.Set
- func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error)
- func (f *Fs) ListR(ctx context.Context, dir string, callback fs.ListRCallback) (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) Name() string
- func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, 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) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
- func (f *Fs) Rmdir(ctx context.Context, dir string) error
- func (f *Fs) Root() string
- func (f *Fs) Shutdown(ctx context.Context) error
- func (f *Fs) String() string
- type Object
- func (o *Object) Fs() fs.Info
- func (o *Object) GetTier() string
- func (o *Object) ID() string
- func (o *Object) MimeType(ctx context.Context) (mimeType string)
- func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error)
- func (o *Object) Remove(ctx context.Context) error
- func (o *Object) SetModTime(ctx context.Context, t time.Time) error
- func (o *Object) SetTier(tier string) error
- func (o *Object) UnWrapUpstream() *upstream.Object
- func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Directory ¶ added in v1.52.0
Directory describes a union Directory
This is a wrapped object contains all candidates
type Errors ¶ added in v1.52.0
type Errors []error
The Errors type wraps a slice of errors
func (Errors) Err ¶ added in v1.52.0
Err returns an error interface that filtered nil, or nil if no non-nil Error is presented.
type Fs ¶
type Fs struct {
// contains filtered or unexported fields
}
Fs represents a union of upstreams
func (*Fs) ChangeNotify ¶
func (f *Fs) ChangeNotify(ctx context.Context, fn func(string, fs.EntryType), ch <-chan time.Duration)
ChangeNotify calls the passed function with a path that has had changes. If the implementation uses polling, it should adhere to the given interval. At least one value will be written to the channel, specifying the initial value and updated values might follow. A 0 Duration should pause the polling. The ChangeNotify implementation must empty the channel regularly. When the channel gets closed, the implementation should stop polling and release resources.
func (*Fs) CleanUp ¶ added in v1.63.0
CleanUp the trash in the Fs
Implement this if you have a way of emptying the trash or otherwise cleaning up old versions of files.
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) DirCacheFlush ¶
func (f *Fs) DirCacheFlush()
DirCacheFlush resets the directory cache - used in testing as an optional interface
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
func (*Fs) List ¶
List the objects and directories in dir into entries. The entries can be returned in any order but should be for a complete directory.
dir should be "" to list the root, and should not have trailing slashes.
This should return ErrDirNotFound if the directory isn't found.
func (*Fs) ListR ¶ added in v1.52.0
ListR lists the objects and directories of the Fs starting from dir recursively into out.
dir should be "" to start from the root, and should not have trailing slashes.
This should return ErrDirNotFound if the directory isn't found.
It should call callback for each tranche of entries read. These need not be returned in any particular order. If callback returns an error then the listing will stop immediately.
Don't implement this unless you have a more efficient way of listing recursively that doing a directory traversal.
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) Purge ¶
Purge all files in the directory
Implement this if you have a way of deleting all the files quicker than just running Remove() on the result of List()
Return an error if it doesn't exist
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
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) PutStream ¶
func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
PutStream uploads to the remote path with the modTime given of indeterminate size
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
type Object ¶
Object describes a union Object
This is a wrapped object which returns the Union Fs as its parent
func (*Object) Open ¶ added in v1.64.0
func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error)
Open opens the file for read. Call Close() on the returned io.ReadCloser
func (*Object) SetModTime ¶ added in v1.52.0
SetModTime sets the metadata on the object to set the modification date
func (*Object) SetTier ¶ added in v1.59.0
SetTier performs changing storage tier of the Object if multiple storage classes supported
func (*Object) UnWrapUpstream ¶ added in v1.59.0
UnWrapUpstream returns the upstream Object that this Object is wrapping
func (*Object) Update ¶ added in v1.52.0
func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error
Update in to the object 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), Upload should either return an error or update the object properly (rather than e.g. calling panic).
Directories ¶
Path | Synopsis |
---|---|
Package common defines code common to the union and the policies
|
Package common defines code common to the union and the policies |
Package policy provides utilities for the union implementation.
|
Package policy provides utilities for the union implementation. |
Package upstream provides utility functionality to union.
|
Package upstream provides utility functionality to union. |