local

package
v0.0.0-...-10c04df Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
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

func StopWatcher

func StopWatcher() error

StopWatcher stops the local file system monitoring

Types

type ChangeHandler

type ChangeHandler func(*syncer.Profile, syncer.Syncer)

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 New

func New(filePath string) (*File, error)

New Returns a File from the local machine for use in syncing

func (*File) Children

func (f *File) Children() ([]*File, error)

Children returns the child files for this given File, will only return records if the file is a Dir

func (*File) CreateDir

func (f *File) CreateDir() (syncer.Syncer, error)

CreateDir creates a New Directory based on the non-existant syncer's name

func (*File) Delete

func (f *File) Delete() error

Delete deletes the file

func (*File) Deleted

func (f *File) Deleted() bool

Deleted - If the file doesn't exist was it deleted

func (*File) Exists

func (f *File) Exists() bool

Exists is whether or not the file exists

func (*File) ID

func (f *File) ID() string

ID is the unique identifier for a local file

func (*File) IsDir

func (f *File) IsDir() bool

IsDir is whether or not the file is a directory

func (*File) Modified

func (f *File) Modified() time.Time

Modified is the date the file was last modified

func (*File) Open

func (f *File) Open() (io.ReadCloser, error)

Open returns a readcloser for reading from the file

func (*File) Path

func (f *File) Path(p *syncer.Profile) string

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

func (f *File) Rename() error

Rename renames the file based on the filename and the time the rename function is called

func (*File) SetDeleted

func (f *File) SetDeleted(deleted bool)

SetDeleted is used for setting the deleted value

func (*File) Size

func (f *File) Size() int64

Size returns the size of the file

func (*File) StartMonitor

func (f *File) StartMonitor(p *syncer.Profile) error

StartMonitor starts Monitoring this syncer for changes (Dir's only), calls profile.Sync method on all changes, and initial startup

func (*File) StopMonitor

func (f *File) StopMonitor(p *syncer.Profile) error

StopMonitor stops Monitoring this syncer for changes

func (*File) Write

func (f *File) Write(r io.ReadCloser, size int64, modTime time.Time) error

Write writes from the reader to the Syncer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL