Documentation ¶
Overview ¶
Local filesystem interface
Index ¶
- func NewFs(name, root string) (fs.Fs, error)
- type FsLocal
- func (dstFs *FsLocal) DirMove(src fs.Fs) error
- func (f *FsLocal) List() fs.ObjectsChan
- func (f *FsLocal) ListDir() fs.DirChan
- func (f *FsLocal) Mkdir() error
- func (dstFs *FsLocal) Move(src fs.Object, remote string) (fs.Object, error)
- func (f *FsLocal) Name() string
- func (f *FsLocal) NewFsObject(remote string) fs.Object
- func (f *FsLocal) Precision() (precision time.Duration)
- func (f *FsLocal) Purge() error
- func (f *FsLocal) Put(in io.Reader, remote string, modTime time.Time, size int64) (fs.Object, error)
- func (f *FsLocal) Rmdir() error
- func (f *FsLocal) Root() string
- func (f *FsLocal) String() string
- type FsObjectLocal
- func (o *FsObjectLocal) Fs() fs.Fs
- func (o *FsObjectLocal) Md5sum() (string, error)
- func (o *FsObjectLocal) ModTime() time.Time
- func (o *FsObjectLocal) Open() (in io.ReadCloser, err error)
- func (o *FsObjectLocal) Remote() string
- func (o *FsObjectLocal) Remove() error
- func (o *FsObjectLocal) SetModTime(modTime time.Time)
- func (o *FsObjectLocal) Size() int64
- func (o *FsObjectLocal) Storable() bool
- func (o *FsObjectLocal) String() string
- func (o *FsObjectLocal) Update(in io.Reader, modTime time.Time, size int64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FsLocal ¶
type FsLocal struct {
// contains filtered or unexported fields
}
FsLocal represents a local filesystem rooted at root
func (*FsLocal) 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 (*FsLocal) List ¶
func (f *FsLocal) List() fs.ObjectsChan
List the path returning a channel of FsObjects
Ignores everything which isn't Storable, eg links etc
func (*FsLocal) 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 (*FsLocal) Purge ¶
Purge deletes all the files and directories
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 (*FsLocal) Put ¶
func (f *FsLocal) Put(in io.Reader, remote string, modTime time.Time, size int64) (fs.Object, error)
Puts the FsObject to the local filesystem
type FsObjectLocal ¶
type FsObjectLocal struct {
// contains filtered or unexported fields
}
FsObjectLocal represents a local filesystem object
func (*FsObjectLocal) Md5sum ¶
func (o *FsObjectLocal) Md5sum() (string, error)
Md5sum calculates the Md5sum of a file returning a lowercase hex string
func (*FsObjectLocal) ModTime ¶
func (o *FsObjectLocal) ModTime() time.Time
ModTime returns the modification time of the object
func (*FsObjectLocal) Open ¶
func (o *FsObjectLocal) Open() (in io.ReadCloser, err error)
Open an object for read
func (*FsObjectLocal) SetModTime ¶
func (o *FsObjectLocal) SetModTime(modTime time.Time)
Sets the modification time of the local fs object
func (*FsObjectLocal) Size ¶
func (o *FsObjectLocal) Size() int64
Size returns the size of an object in bytes