Documentation ¶
Index ¶
- Constants
- func StartWatcher(handler ChangeHandler) error
- func StopWatcher() error
- type ChangeHandler
- type File
- func (f *File) Children() ([]*File, error)
- func (f *File) CreateDir() (syncer.Syncer, error)
- func (f *File) Delete() error
- func (f *File) Deleted() bool
- func (f *File) Exists() bool
- func (f *File) ID() string
- func (f *File) IsDir() bool
- func (f *File) Modified() time.Time
- func (f *File) Open() (io.ReadCloser, error)
- func (f *File) Path(p *syncer.Profile) string
- func (f *File) Rename() error
- func (f *File) SetDeleted(deleted bool)
- func (f *File) Size() int64
- func (f *File) StartMonitor(p *syncer.Profile) error
- func (f *File) StopMonitor(p *syncer.Profile) error
- func (f *File) Write(r io.ReadCloser, size int64, modTime time.Time) error
Constants ¶
const LogType = "local"
LogType is the log type for local syncing
Variables ¶
This section is empty.
Functions ¶
func StartWatcher ¶
func StartWatcher(handler ChangeHandler) error
StartWatcher Starts local file system monitoring
Types ¶
type ChangeHandler ¶
ChangeHandler is the function called when a change occurs in a monitored folder
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is implements the syncer.Syncer interface for a file on the local machine
func (*File) Children ¶
Children returns the child files for this given File, will only return records if the file is a Dir
func (*File) Open ¶
func (f *File) Open() (io.ReadCloser, error)
Open returns a readcloser for reading from the file
func (*File) Path ¶
Path is the path to the local file based on the root syncer. If file is root syncer path then return full path
func (*File) Rename ¶
Rename renames the file based on the filename and the time the rename function is called
func (*File) SetDeleted ¶
SetDeleted is used for setting the deleted value
func (*File) StartMonitor ¶
StartMonitor starts Monitoring this syncer for changes (Dir's only), calls profile.Sync method on all changes, and initial startup
func (*File) StopMonitor ¶
StopMonitor stops Monitoring this syncer for changes