syncer

package
v0.4.1-beta Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2015 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(logger log.Logger)

@param1 interface log.Logger package github.com/Felamande/filesync/log

type Logger interface {
	Info(source, messsage string)
	Debug(source, messsage string)
	Warn(source, messsage string)
	Error(source, messsage string)
	Critical(source, messsage string)
	Panic(source, messsage string)
	Close() error
}

Types

type DirHandler

type DirHandler func(string)

type FileHandler

type FileHandler func(string)

type GlobalConfig

type GlobalConfig struct {
}

type PairNotValidError

type PairNotValidError struct {
	Left    string
	Right   string
	Message string
}

func (PairNotValidError) Error

func (e PairNotValidError) Error() string

type SavedConfig

type SavedConfig struct {
	Pairs []SyncPairConfig `json:"pairs"`
	Port  string           `json:"port"`
}

type SyncConfig

type SyncConfig struct {
	CoverSameName bool `json:"cover_same_name"`
	SyncDelete    bool `json:"sync_delete"`
	SyncRename    bool `json:"sync_rename"`
}

type SyncMsg

type SyncMsg struct {
	Op   fsnotify.Op
	Left uri.Uri
}

type SyncPair

type SyncPair struct {
	Left   uri.Uri
	Right  uri.Uri
	Config SyncConfig
	// contains filtered or unexported fields
}

func (*SyncPair) BeginWatch

func (p *SyncPair) BeginWatch()

func (*SyncPair) ToRight

func (p *SyncPair) ToRight(u uri.Uri) (uri.Uri, error)

func (*SyncPair) WatchLeft

func (p *SyncPair) WatchLeft(left uri.Uri) error

type SyncPairConfig

type SyncPairConfig struct {
	Left   string     `json:"left"`
	Right  string     `json:"right"`
	Config SyncConfig `json:"config"`
}

type Syncer

type Syncer struct {
	SyncPairs []*SyncPair
}

func New

func New() *Syncer

func (*Syncer) NewPair

func (s *Syncer) NewPair(config SyncConfig, source, target string) error

func (*Syncer) Run

func (s *Syncer) Run(config SavedConfig)

func (*Syncer) UpdateConfig

func (s *Syncer) UpdateConfig(file string)

func (*Syncer) WatchConfigChange

func (s *Syncer) WatchConfigChange(file string) error

Jump to

Keyboard shortcuts

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