remote

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: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//LogType is the log type for remote logging
	LogType = "remote"
)

Variables

This section is empty.

Functions

func PauseWatcher

func PauseWatcher()

PauseWatcher temporarily stops remote monitoring

func ResumeWatcher

func ResumeWatcher()

ResumeWatcher resumes remote monitoring

func StartWatcher

func StartWatcher(handler ChangeHandler, interval time.Duration) error

StartWatcher Starts remote file system monitoring

func StopWatcher

func StopWatcher()

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 {
	Name         string    `json:"name"`
	FullURL      string    `json:"fullUrl"`
	URL          string    `json:"path"`
	ModifiedTime time.Time `json:"modified"`
	// contains filtered or unexported fields
}

File is implements the syncer.Syncer interface for a file on the Remote machine

func New

func New(client *fh.Client, filePath string) (*File, error)

New Returns a File from the remote instance 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) Client

func (f *File) Client() *fh.Client

Client is the freehold client used to retrieve this file

func (*File) Close

func (f *File) Close() error

Close closes an open file reader

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 remote file the full URL of the 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 ReadWriteCloser for reading, and writing data to the file

func (*File) Path

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

Path is the path relative to the passed in profile if path is root to the profile, then return the full path without the domain

func (*File) Read

func (f *File) Read(p []byte) (n int, err error)

Read reads the data out of the remote file

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

func (*File) StopMonitor

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

StopMonitor stops Monitoring this syncer for changes (Dir's only)

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