Documentation ¶
Index ¶
- Variables
- func Compare(l esl.Logger, localFile es_fileentry.LocalEntry, dbxEntry mo_file.Entry) (bool, error)
- func CompareLevel(logger esl.Logger, sourceFs es_filesystem.FileSystem, ...) error
- type CompareFolder
- type EntryDataPair
- type EntryPair
- type FileComparator
- type FileDiff
- type FolderComparator
- type HashComparator
- type LocalDropboxComparator
- type MissingSource
- type MissingTarget
- type Opt
- type Opts
- func (z Opts) Apply(opts []Opt) Opts
- func (z Opts) Log() esl.Logger
- func (z Opts) ReportFileDiff(base PathPair, source, target es_filesystem.Entry)
- func (z Opts) ReportMissingSource(base PathPair, source es_filesystem.Entry)
- func (z Opts) ReportMissingTarget(base PathPair, target es_filesystem.Entry)
- func (z Opts) ReportSameFile(base PathPair, source, target es_filesystem.Entry)
- func (z Opts) ReportTypeDiff(base PathPair, source, target es_filesystem.Entry)
- type PathDataPair
- type PathPair
- type SameFile
- type SizeComparator
- type TaskCompareEntry
- type TimeComparator
- type TypeDiff
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrorUnknownEntryState = errors.New("unknown entry state")
)
Functions ¶
func Compare ¶
func Compare(l esl.Logger, localFile es_fileentry.LocalEntry, dbxEntry mo_file.Entry) (bool, error)
Returns true if it determined as same file
func CompareLevel ¶
func CompareLevel( logger esl.Logger, sourceFs es_filesystem.FileSystem, targetFs es_filesystem.FileSystem, sourcePath es_filesystem.Path, targetPath es_filesystem.Path, comparator FileComparator, handlerMissingSource MissingSource, handlerMissingTarget MissingTarget, handlerFileDiff FileDiff, handlerTypeDiff TypeDiff, handlerSameFile SameFile, handlerCompareFolder CompareFolder, ) error
Types ¶
type CompareFolder ¶
type CompareFolder func(base PathPair, source, target es_filesystem.Entry)
type EntryDataPair ¶
type EntryDataPair struct { SourceData es_filesystem.EntryData `json:"source_data"` TargetData es_filesystem.EntryData `json:"target_data"` }
type EntryPair ¶
type EntryPair struct { Source es_filesystem.Entry Target es_filesystem.Entry }
type FileComparator ¶
type FileComparator interface {
Compare(source, target es_filesystem.Entry) (same bool, err es_filesystem.FileSystemError)
}
func New ¶
func New(opt ...Opt) FileComparator
type FileDiff ¶
type FileDiff func(base PathPair, source, target es_filesystem.Entry)
type FolderComparator ¶
type FolderComparator interface { Compare(source, target es_filesystem.Path) (err error) CompareAndSummarize(source, target es_filesystem.Path) (missingSource, missingTarget []es_filesystem.Entry, fileDiffs, typeDiffs []EntryDataPair, err error) }
func NewFolderComparator ¶
func NewFolderComparator(source, target es_filesystem.FileSystem, seq eq_sequence.Sequence, opt ...Opt) FolderComparator
type HashComparator ¶
type HashComparator struct {
// contains filtered or unexported fields
}
func (HashComparator) Compare ¶
func (z HashComparator) Compare(localFile es_fileentry.LocalEntry, dbxEntry mo_file.Entry) (bool, error)
type LocalDropboxComparator ¶
type LocalDropboxComparator interface {
Compare(localFile es_fileentry.LocalEntry, dbxEntry mo_file.Entry) (bool, error)
}
type MissingSource ¶
type MissingSource func(base PathPair, target es_filesystem.Entry)
type MissingTarget ¶
type MissingTarget func(base PathPair, source es_filesystem.Entry)
type Opt ¶
func DontCompareContent ¶
func DontCompareTime ¶
func HandlerFileDiff ¶
func HandlerMissingSource ¶
func HandlerMissingSource(h MissingSource) Opt
func HandlerMissingTarget ¶
func HandlerMissingTarget(h MissingTarget) Opt
func HandlerSameFile ¶
func HandlerTypeDiff ¶
type Opts ¶
type Opts struct {
// contains filtered or unexported fields
}
func (Opts) ReportFileDiff ¶
func (z Opts) ReportFileDiff(base PathPair, source, target es_filesystem.Entry)
func (Opts) ReportMissingSource ¶
func (z Opts) ReportMissingSource(base PathPair, source es_filesystem.Entry)
func (Opts) ReportMissingTarget ¶
func (z Opts) ReportMissingTarget(base PathPair, target es_filesystem.Entry)
func (Opts) ReportSameFile ¶
func (z Opts) ReportSameFile(base PathPair, source, target es_filesystem.Entry)
func (Opts) ReportTypeDiff ¶
func (z Opts) ReportTypeDiff(base PathPair, source, target es_filesystem.Entry)
type PathDataPair ¶
type PathDataPair struct { SourceData es_filesystem.PathData `json:"source_data"` TargetData es_filesystem.PathData `json:"target_data"` }
type PathPair ¶
type PathPair struct { Source es_filesystem.Path Target es_filesystem.Path }
type SameFile ¶
type SameFile func(base PathPair, source, target es_filesystem.Entry)
type SizeComparator ¶
type SizeComparator struct {
// contains filtered or unexported fields
}
func (SizeComparator) Compare ¶
func (z SizeComparator) Compare(localFile es_fileentry.LocalEntry, dbxEntry mo_file.Entry) (bool, error)
type TaskCompareEntry ¶
type TaskCompareEntry struct { Source es_filesystem.PathData `json:"source"` Target es_filesystem.PathData `json:"target"` }
type TimeComparator ¶
type TimeComparator struct {
// contains filtered or unexported fields
}
func (TimeComparator) Compare ¶
func (z TimeComparator) Compare(localFile es_fileentry.LocalEntry, dbxEntry mo_file.Entry) (bool, error)
type TypeDiff ¶
type TypeDiff func(base PathPair, source, target es_filesystem.Entry)
Click to show internal directories.
Click to hide internal directories.