rclone: github.com/ncw/rclone/backend/union Index | Files

package union

import "github.com/ncw/rclone/backend/union"

Index

Package Files

union.go

func NewFs Uses

func NewFs(name, root string, m configmap.Mapper) (fs.Fs, error)

NewFs constructs an Fs from the path.

The returned Fs is the actual Fs, referenced by remote in the config

type Fs Uses

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

Fs represents a union of remotes

func (*Fs) About Uses

func (f *Fs) About() (*fs.Usage, error)

About gets quota information from the Fs

func (*Fs) ChangeNotify Uses

func (f *Fs) ChangeNotify(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) Copy Uses

func (f *Fs) Copy(src fs.Object, remote string) (fs.Object, error)

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 Uses

func (f *Fs) DirCacheFlush()

DirCacheFlush resets the directory cache - used in testing as an optional interface

func (*Fs) DirMove Uses

func (f *Fs) DirMove(src fs.Fs, srcRemote, dstRemote string) error

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) Features Uses

func (f *Fs) Features() *fs.Features

Features returns the optional features of this Fs

func (*Fs) Hashes Uses

func (f *Fs) Hashes() hash.Set

Hashes returns hash.HashNone to indicate remote hashing is unavailable

func (*Fs) List Uses

func (f *Fs) List(dir string) (entries fs.DirEntries, err error)

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) Mkdir Uses

func (f *Fs) Mkdir(dir string) error

Mkdir makes the root directory of the Fs object

func (*Fs) Move Uses

func (f *Fs) Move(src fs.Object, remote string) (fs.Object, error)

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) Name Uses

func (f *Fs) Name() string

Name of the remote (as passed into NewFs)

func (*Fs) NewObject Uses

func (f *Fs) NewObject(path string) (fs.Object, error)

NewObject creates a new remote union file object based on the first Object it finds (reverse remote order)

func (*Fs) Precision Uses

func (f *Fs) Precision() time.Duration

Precision is the greatest Precision of all remotes

func (*Fs) Purge Uses

func (f *Fs) Purge() error

Purge all files in the root and the root 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 Uses

func (f *Fs) Put(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 Uses

func (f *Fs) PutStream(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

func (*Fs) Rmdir Uses

func (f *Fs) Rmdir(dir string) error

Rmdir removes the root directory of the Fs object

func (*Fs) Root Uses

func (f *Fs) Root() string

Root of the remote (as passed into NewFs)

func (*Fs) String Uses

func (f *Fs) String() string

String converts this Fs to a string

type Object Uses

type Object struct {
    fs.Object
    // contains filtered or unexported fields
}

Object describes a union Object

This is a wrapped object which returns the Union Fs as its parent

func (*Object) Fs Uses

func (o *Object) Fs() fs.Info

Fs returns the union Fs as the parent

type Options Uses

type Options struct {
    Remotes fs.SpaceSepList `config:"remotes"`
}

Options defines the configuration for this backend

Package union imports 12 packages (graph) and is imported by 1 packages. Updated 2019-06-06. Refresh now. Tools for package owners.