Documentation ¶
Overview ¶
Dropbox interface
Index ¶
- func NewFs(name, root string) (fs.Fs, error)
- type FsDropbox
- func (f *FsDropbox) Copy(src fs.Object, remote string) (fs.Object, error)
- func (dstFs *FsDropbox) DirMove(src fs.Fs) error
- func (f *FsDropbox) List() fs.ObjectsChan
- func (f *FsDropbox) ListDir() fs.DirChan
- func (f *FsDropbox) Mkdir() error
- func (dstFs *FsDropbox) Move(src fs.Object, remote string) (fs.Object, error)
- func (f *FsDropbox) Name() string
- func (f *FsDropbox) NewFsObject(remote string) fs.Object
- func (f *FsDropbox) Precision() time.Duration
- func (f *FsDropbox) Purge() error
- func (f *FsDropbox) Put(in io.Reader, remote string, modTime time.Time, size int64) (fs.Object, error)
- func (f *FsDropbox) Rmdir() error
- func (f *FsDropbox) Root() string
- func (f *FsDropbox) String() string
- type FsObjectDropbox
- func (o *FsObjectDropbox) Fs() fs.Fs
- func (o *FsObjectDropbox) Md5sum() (string, error)
- func (o *FsObjectDropbox) ModTime() time.Time
- func (o *FsObjectDropbox) Open() (in io.ReadCloser, err error)
- func (o *FsObjectDropbox) Remote() string
- func (o *FsObjectDropbox) Remove() error
- func (o *FsObjectDropbox) SetModTime(modTime time.Time)
- func (o *FsObjectDropbox) Size() int64
- func (o *FsObjectDropbox) Storable() bool
- func (o *FsObjectDropbox) String() string
- func (o *FsObjectDropbox) Update(in io.Reader, modTime time.Time, size int64) error
- type NameTreeFileWalkFunc
- type NameTreeNode
- func (tree *NameTreeNode) GetPathWithCorrectCase(path string) *string
- func (tree *NameTreeNode) PutCaseCorrectDirectoryName(parentPath string, caseCorrectDirectoryName string)
- func (tree *NameTreeNode) PutFile(parentPath string, caseCorrectFileName string, dropboxEntry *dropbox.Entry)
- func (tree *NameTreeNode) String() string
- func (tree *NameTreeNode) WalkFiles(rootPath string, walkFunc NameTreeFileWalkFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FsDropbox ¶
type FsDropbox struct {
// contains filtered or unexported fields
}
FsDropbox represents a remote dropbox server
func (*FsDropbox) 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 (*FsDropbox) DirMove ¶
Move src to this remote 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 (*FsDropbox) List ¶
func (f *FsDropbox) List() fs.ObjectsChan
Walk the path returning a channel of FsObjects
func (*FsDropbox) 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 (*FsDropbox) Purge ¶
Purge deletes all the files and the container
Optional interface: Only implement this if you have a way of deleting all the files quicker than just running Remove() on the result of List()
func (*FsDropbox) Put ¶
func (f *FsDropbox) Put(in io.Reader, remote string, modTime time.Time, size int64) (fs.Object, error)
Put the object
Copy the reader in to the new object which is returned ¶
The new object may have been created if an error is returned
type FsObjectDropbox ¶
type FsObjectDropbox struct {
// contains filtered or unexported fields
}
FsObjectDropbox describes a dropbox object
func (*FsObjectDropbox) Md5sum ¶
func (o *FsObjectDropbox) Md5sum() (string, error)
Md5sum returns the Md5sum of an object returning a lowercase hex string
func (*FsObjectDropbox) ModTime ¶
func (o *FsObjectDropbox) ModTime() time.Time
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 (*FsObjectDropbox) Open ¶
func (o *FsObjectDropbox) Open() (in io.ReadCloser, err error)
Open an object for read
func (*FsObjectDropbox) SetModTime ¶
func (o *FsObjectDropbox) SetModTime(modTime time.Time)
Sets the modification time of the local fs object
Commits the datastore
func (*FsObjectDropbox) Size ¶
func (o *FsObjectDropbox) Size() int64
Size returns the size of an object in bytes
func (*FsObjectDropbox) Storable ¶
func (o *FsObjectDropbox) Storable() bool
Is this object storable
type NameTreeFileWalkFunc ¶
type NameTreeNode ¶
type NameTreeNode struct { // Map from lowercase directory name to tree node Directories map[string]*NameTreeNode // Map from file name (case sensitive) to dropbox entry Files map[string]*dropbox.Entry // Empty string if exact case is unknown or root node CaseCorrectName string }
func NewNameTree ¶
func NewNameTree() *NameTreeNode
func (*NameTreeNode) GetPathWithCorrectCase ¶
func (tree *NameTreeNode) GetPathWithCorrectCase(path string) *string
func (*NameTreeNode) PutCaseCorrectDirectoryName ¶
func (tree *NameTreeNode) PutCaseCorrectDirectoryName(parentPath string, caseCorrectDirectoryName string)
func (*NameTreeNode) PutFile ¶
func (tree *NameTreeNode) PutFile(parentPath string, caseCorrectFileName string, dropboxEntry *dropbox.Entry)
func (*NameTreeNode) String ¶
func (tree *NameTreeNode) String() string
func (*NameTreeNode) WalkFiles ¶
func (tree *NameTreeNode) WalkFiles(rootPath string, walkFunc NameTreeFileWalkFunc)