Use "pack file" instead of "data file" (#2885)

- changed variable names, especially changed DataFile into PackFile
- changed in some comments
- always use "pack file" in docu
This commit is contained in:
aawsome
2020-08-16 11:16:38 +02:00
committed by GitHub
parent 643bbbe156
commit 0fed6a8dfc
45 changed files with 126 additions and 126 deletions

View File

@@ -25,7 +25,7 @@ func TestDefaultLayout(t *testing.T) {
{
tempdir,
filepath.Join,
restic.Handle{Type: restic.DataFile, Name: "0123456"},
restic.Handle{Type: restic.PackFile, Name: "0123456"},
filepath.Join(tempdir, "data", "01", "0123456"),
},
{
@@ -61,7 +61,7 @@ func TestDefaultLayout(t *testing.T) {
{
"",
path.Join,
restic.Handle{Type: restic.DataFile, Name: "0123456"},
restic.Handle{Type: restic.PackFile, Name: "0123456"},
"data/01/0123456",
},
{
@@ -148,7 +148,7 @@ func TestRESTLayout(t *testing.T) {
filename string
}{
{
restic.Handle{Type: restic.DataFile, Name: "0123456"},
restic.Handle{Type: restic.PackFile, Name: "0123456"},
filepath.Join(path, "data", "0123456"),
},
{
@@ -216,7 +216,7 @@ func TestRESTLayoutURLs(t *testing.T) {
}{
{
&RESTLayout{URL: "https://hostname.foo", Path: "", Join: path.Join},
restic.Handle{Type: restic.DataFile, Name: "foobar"},
restic.Handle{Type: restic.PackFile, Name: "foobar"},
"https://hostname.foo/data/foobar",
"https://hostname.foo/data/",
},
@@ -234,7 +234,7 @@ func TestRESTLayoutURLs(t *testing.T) {
},
{
&S3LegacyLayout{URL: "https://hostname.foo", Path: "/", Join: path.Join},
restic.Handle{Type: restic.DataFile, Name: "foobar"},
restic.Handle{Type: restic.PackFile, Name: "foobar"},
"https://hostname.foo/data/foobar",
"https://hostname.foo/data/",
},
@@ -252,7 +252,7 @@ func TestRESTLayoutURLs(t *testing.T) {
},
{
&S3LegacyLayout{URL: "", Path: "", Join: path.Join},
restic.Handle{Type: restic.DataFile, Name: "foobar"},
restic.Handle{Type: restic.PackFile, Name: "foobar"},
"data/foobar",
"data/",
},
@@ -294,7 +294,7 @@ func TestS3LegacyLayout(t *testing.T) {
filename string
}{
{
restic.Handle{Type: restic.DataFile, Name: "0123456"},
restic.Handle{Type: restic.PackFile, Name: "0123456"},
filepath.Join(path, "data", "0123456"),
},
{
@@ -419,8 +419,8 @@ func TestParseLayout(t *testing.T) {
}
// test that the functions work (and don't panic)
_ = layout.Dirname(restic.Handle{Type: restic.DataFile})
_ = layout.Filename(restic.Handle{Type: restic.DataFile, Name: "1234"})
_ = layout.Dirname(restic.Handle{Type: restic.PackFile})
_ = layout.Filename(restic.Handle{Type: restic.PackFile, Name: "1234"})
_ = layout.Paths()
layoutName := fmt.Sprintf("%T", layout)