lib/scanner need not depend on lib/ignore

This commit is contained in:
Jakob Borg 2015-09-04 11:50:47 +02:00
parent 3d6ea23511
commit 54269553c8

View File

@ -19,7 +19,6 @@ import (
"github.com/syncthing/protocol"
"github.com/syncthing/syncthing/lib/db"
"github.com/syncthing/syncthing/lib/events"
"github.com/syncthing/syncthing/lib/ignore"
"github.com/syncthing/syncthing/lib/osutil"
"github.com/syncthing/syncthing/lib/symlinks"
"golang.org/x/text/unicode/norm"
@ -50,7 +49,7 @@ type Walker struct {
// BlockSize controls the size of the block used when hashing.
BlockSize int
// If Matcher is not nil, it is used to identify files to ignore which were specified by the user.
Matcher *ignore.Matcher
Matcher IgnoreMatcher
// If TempNamer is not nil, it is used to ignore temporary files when walking.
TempNamer TempNamer
// Number of hours to keep temporary files for
@ -87,6 +86,11 @@ type CurrentFiler interface {
CurrentFile(name string) (protocol.FileInfo, bool)
}
type IgnoreMatcher interface {
// Match returns true if the file should be ignored.
Match(filename string) bool
}
// Walk returns the list of files found in the local folder by scanning the
// file system. Files are blockwise hashed.
func (w *Walker) Walk() (chan protocol.FileInfo, error) {