Move FileInfoTruncated to files package

This is where it's used, and it clarifies that it's never used over the
wire.
This commit is contained in:
Jakob Borg
2015-01-09 08:19:32 +01:00
parent 8bc7d259f4
commit 4c4143d9be
11 changed files with 227 additions and 188 deletions

View File

@@ -36,6 +36,7 @@ import (
"github.com/syncthing/syncthing/internal/config"
"github.com/syncthing/syncthing/internal/discover"
"github.com/syncthing/syncthing/internal/events"
"github.com/syncthing/syncthing/internal/files"
"github.com/syncthing/syncthing/internal/model"
"github.com/syncthing/syncthing/internal/osutil"
"github.com/syncthing/syncthing/internal/protocol"
@@ -782,9 +783,9 @@ func mimeTypeForFile(file string) string {
}
}
func toNeedSlice(files []protocol.FileInfoTruncated) []map[string]interface{} {
output := make([]map[string]interface{}, len(files))
for i, file := range files {
func toNeedSlice(fs []files.FileInfoTruncated) []map[string]interface{} {
output := make([]map[string]interface{}, len(fs))
for i, file := range fs {
output[i] = map[string]interface{}{
"Name": file.Name,
"Flags": file.Flags,
@@ -792,7 +793,7 @@ func toNeedSlice(files []protocol.FileInfoTruncated) []map[string]interface{} {
"Version": file.Version,
"LocalVersion": file.LocalVersion,
"NumBlocks": file.NumBlocks,
"Size": protocol.BlocksToSize(file.NumBlocks),
"Size": files.BlocksToSize(file.NumBlocks),
}
}
return output