lib/versioner: Restore for all versioners, cross-device support (#5514)

* lib/versioner: Restore for all versioners, cross-device support

Fixes #4631
Fixes #4586
Fixes #1634
Fixes #5338
Fixes #5419
This commit is contained in:
Audrius Butkevicius
2019-04-28 23:30:16 +01:00
committed by GitHub
parent 2984d40641
commit 0ca1f26ff8
14 changed files with 636 additions and 289 deletions

View File

@@ -9,6 +9,7 @@
package versioner
import (
"fmt"
"time"
"github.com/syncthing/syncthing/lib/fs"
@@ -16,6 +17,8 @@ import (
type Versioner interface {
Archive(filePath string) error
GetVersions() (map[string][]FileVersion, error)
Restore(filePath string, versionTime time.Time) error
}
type FileVersion struct {
@@ -25,6 +28,7 @@ type FileVersion struct {
}
var Factories = map[string]func(folderID string, filesystem fs.Filesystem, params map[string]string) Versioner{}
var ErrRestorationNotSupported = fmt.Errorf("version restoration not supported with the current versioner")
const (
TimeFormat = "20060102-150405"