Deprecate scanner.Block & File

This commit is contained in:
Jakob Borg
2014-07-12 23:06:48 +02:00
parent 91b35118d9
commit 655acb4cb2
21 changed files with 269 additions and 480 deletions

View File

@@ -18,7 +18,6 @@ import (
"code.google.com/p/go.crypto/bcrypt"
"github.com/calmh/syncthing/logger"
"github.com/calmh/syncthing/protocol"
"github.com/calmh/syncthing/scanner"
)
var l = logger.DefaultLogger
@@ -122,11 +121,11 @@ func (r *RepositoryConfiguration) NodeIDs() []protocol.NodeID {
return r.nodeIDs
}
func (r RepositoryConfiguration) FileRanker() func(scanner.File) int {
func (r RepositoryConfiguration) FileRanker() func(protocol.FileInfo) int {
if len(r.SyncOrderPatterns) <= 0 {
return nil
}
return func(f scanner.File) int {
return func(f protocol.FileInfo) int {
ret := 0
for _, v := range r.SyncOrderPatterns {
if v.CompiledPattern().MatchString(f.Name) {

View File

@@ -13,7 +13,6 @@ import (
"github.com/calmh/syncthing/files"
"github.com/calmh/syncthing/protocol"
"github.com/calmh/syncthing/scanner"
)
var node1, node2, node3, node4 protocol.NodeID
@@ -274,7 +273,7 @@ func TestFileSorter(t *testing.T) {
},
}
f := []scanner.File{
f := []protocol.FileInfo{
{Name: "bar.mov"},
{Name: "baz.txt"},
{Name: "foo.jpg"},
@@ -290,7 +289,7 @@ func TestFileSorter(t *testing.T) {
files.SortBy(rcfg.FileRanker()).Sort(f)
expected := []scanner.File{
expected := []protocol.FileInfo{
{Name: "camera-uploads/foo.jpg"},
{Name: "camera-uploads/herp.mov"},
{Name: "camera-uploads/hurr.pl"},
@@ -314,7 +313,7 @@ func TestFileSorter(t *testing.T) {
}
}
func formatFiles(f []scanner.File) string {
func formatFiles(f []protocol.FileInfo) string {
ret := ""
for _, v := range f {