lib/versioner: Reduce surface area (#6186)
* lib/versioner: Reduce surface area This is a refactor while I was anyway rooting around in the versioner. Instead of exporting every possible implementation and the factory and letting the caller do whatever, this now encapsulates all that and exposes a New() that takes a config.VersioningConfiguration. Given that and that we don't know (from the outside) how a versioner works or what state it keeps, we now just construct it once per folder and keep it around. Previously it was recreated for each restore request. * unparam * wip
This commit is contained in:
committed by
Audrius Butkevicius
parent
f747ba6d69
commit
4e151d380c
@@ -41,7 +41,7 @@ func TestTaggedFilename(t *testing.T) {
|
||||
}
|
||||
|
||||
// Test parser
|
||||
tag := ExtractTag(tc[2])
|
||||
tag := extractTag(tc[2])
|
||||
if tag != tc[1] {
|
||||
t.Errorf("%s != %s", tag, tc[1])
|
||||
}
|
||||
@@ -61,7 +61,7 @@ func TestSimpleVersioningVersionCount(t *testing.T) {
|
||||
|
||||
fs := fs.NewFilesystem(fs.FilesystemTypeBasic, dir)
|
||||
|
||||
v := NewSimple("", fs, map[string]string{"keep": "2"})
|
||||
v := newSimple(fs, map[string]string{"keep": "2"})
|
||||
|
||||
path := "test"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user