diff --git a/internal/backend/azure/azure.go b/internal/backend/azure/azure.go index e9368c268..9f879f989 100644 --- a/internal/backend/azure/azure.go +++ b/internal/backend/azure/azure.go @@ -190,11 +190,6 @@ func (be *Backend) Connections() uint { return be.connections } -// Location returns this backend's location (the container name). -func (be *Backend) Location() string { - return be.Join(be.cfg.AccountName, be.cfg.Prefix) -} - // Hasher may return a hash function for calculating a content hash for the backend func (be *Backend) Hasher() hash.Hash { return md5.New() diff --git a/internal/backend/b2/b2.go b/internal/backend/b2/b2.go index e3a52813d..1a5e72aaa 100644 --- a/internal/backend/b2/b2.go +++ b/internal/backend/b2/b2.go @@ -162,11 +162,6 @@ func (be *b2Backend) Connections() uint { return be.cfg.Connections } -// Location returns the location for the backend. -func (be *b2Backend) Location() string { - return be.cfg.Bucket -} - // Hasher may return a hash function for calculating a content hash for the backend func (be *b2Backend) Hasher() hash.Hash { return nil diff --git a/internal/backend/backend.go b/internal/backend/backend.go index 102322c4f..3b0599c30 100644 --- a/internal/backend/backend.go +++ b/internal/backend/backend.go @@ -14,10 +14,6 @@ import ( // the context package need not be wrapped, as context cancellation is checked // separately by the retrying logic. type Backend interface { - // Location returns a string that describes the type and location of the - // repository. - Location() string - // Connections returns the maximum number of concurrent backend operations. Connections() uint diff --git a/internal/backend/dryrun/dry_backend.go b/internal/backend/dryrun/dry_backend.go index c17b240fa..8af0ce9ad 100644 --- a/internal/backend/dryrun/dry_backend.go +++ b/internal/backend/dryrun/dry_backend.go @@ -46,11 +46,6 @@ func (be *Backend) Connections() uint { return be.b.Connections() } -// Location returns the location of the backend. -func (be *Backend) Location() string { - return "DRY:" + be.b.Location() -} - // Delete removes all data in the backend. func (be *Backend) Delete(_ context.Context) error { return nil diff --git a/internal/backend/dryrun/dry_backend_test.go b/internal/backend/dryrun/dry_backend_test.go index 793e544db..be98f5310 100644 --- a/internal/backend/dryrun/dry_backend_test.go +++ b/internal/backend/dryrun/dry_backend_test.go @@ -36,7 +36,6 @@ func TestDry(t *testing.T) { content string wantErr string }{ - {d, "loc", "", "DRY:RAM", ""}, {d, "delete", "", "", ""}, {d, "stat", "a", "", "not found"}, {d, "list", "", "", ""}, @@ -76,11 +75,6 @@ func TestDry(t *testing.T) { if files != step.content { t.Errorf("%d. List = %q, want %q", i, files, step.content) } - case "loc": - loc := step.be.Location() - if loc != step.content { - t.Errorf("%d. Location = %q, want %q", i, loc, step.content) - } case "delete": err = step.be.Delete(ctx) case "remove": diff --git a/internal/backend/gs/gs.go b/internal/backend/gs/gs.go index 20da5245a..305e9b9c1 100644 --- a/internal/backend/gs/gs.go +++ b/internal/backend/gs/gs.go @@ -197,11 +197,6 @@ func (be *Backend) Connections() uint { return be.connections } -// Location returns this backend's location (the bucket name). -func (be *Backend) Location() string { - return be.Join(be.bucketName, be.prefix) -} - // Hasher may return a hash function for calculating a content hash for the backend func (be *Backend) Hasher() hash.Hash { return md5.New() diff --git a/internal/backend/local/local.go b/internal/backend/local/local.go index 599bee0f6..f041d608a 100644 --- a/internal/backend/local/local.go +++ b/internal/backend/local/local.go @@ -93,11 +93,6 @@ func (b *Local) Connections() uint { return b.Config.Connections } -// Location returns this backend's location (the directory name). -func (b *Local) Location() string { - return b.Path -} - // Hasher may return a hash function for calculating a content hash for the backend func (b *Local) Hasher() hash.Hash { return nil diff --git a/internal/backend/mem/mem_backend.go b/internal/backend/mem/mem_backend.go index 532380f21..981c0a182 100644 --- a/internal/backend/mem/mem_backend.go +++ b/internal/backend/mem/mem_backend.go @@ -222,11 +222,6 @@ func (be *MemoryBackend) Connections() uint { return connectionCount } -// Location returns the location of the backend (RAM). -func (be *MemoryBackend) Location() string { - return "RAM" -} - // Hasher may return a hash function for calculating a content hash for the backend func (be *MemoryBackend) Hasher() hash.Hash { return xxhash.New() diff --git a/internal/backend/mock/backend.go b/internal/backend/mock/backend.go index bd8c6d43b..a03198443 100644 --- a/internal/backend/mock/backend.go +++ b/internal/backend/mock/backend.go @@ -21,7 +21,6 @@ type Backend struct { RemoveFn func(ctx context.Context, h backend.Handle) error DeleteFn func(ctx context.Context) error ConnectionsFn func() uint - LocationFn func() string HasherFn func() hash.Hash HasAtomicReplaceFn func() bool } @@ -49,15 +48,6 @@ func (m *Backend) Connections() uint { return m.ConnectionsFn() } -// Location returns a location string. -func (m *Backend) Location() string { - if m.LocationFn == nil { - return "" - } - - return m.LocationFn() -} - // Hasher may return a hash function for calculating a content hash for the backend func (m *Backend) Hasher() hash.Hash { if m.HasherFn == nil { diff --git a/internal/backend/rest/rest.go b/internal/backend/rest/rest.go index f743c3e50..1af88ec3f 100644 --- a/internal/backend/rest/rest.go +++ b/internal/backend/rest/rest.go @@ -121,11 +121,6 @@ func (b *Backend) Connections() uint { return b.connections } -// Location returns this backend's location (the server's URL). -func (b *Backend) Location() string { - return b.url.String() -} - // Hasher may return a hash function for calculating a content hash for the backend func (b *Backend) Hasher() hash.Hash { return nil diff --git a/internal/backend/s3/s3.go b/internal/backend/s3/s3.go index a2c95ac32..bddb57741 100644 --- a/internal/backend/s3/s3.go +++ b/internal/backend/s3/s3.go @@ -321,11 +321,6 @@ func (be *Backend) Connections() uint { return be.cfg.Connections } -// Location returns this backend's location (the bucket name). -func (be *Backend) Location() string { - return be.Join(be.cfg.Bucket, be.cfg.Prefix) -} - // Hasher may return a hash function for calculating a content hash for the backend func (be *Backend) Hasher() hash.Hash { return nil diff --git a/internal/backend/sftp/sftp.go b/internal/backend/sftp/sftp.go index 3591c1530..70fc30a62 100644 --- a/internal/backend/sftp/sftp.go +++ b/internal/backend/sftp/sftp.go @@ -292,11 +292,6 @@ func (r *SFTP) Connections() uint { return r.Config.Connections } -// Location returns this backend's location (the directory name). -func (r *SFTP) Location() string { - return r.p -} - // Hasher may return a hash function for calculating a content hash for the backend func (r *SFTP) Hasher() hash.Hash { return nil diff --git a/internal/backend/swift/swift.go b/internal/backend/swift/swift.go index 1643af7fc..e6412d0bf 100644 --- a/internal/backend/swift/swift.go +++ b/internal/backend/swift/swift.go @@ -118,11 +118,6 @@ func (be *beSwift) Connections() uint { return be.connections } -// Location returns this backend's location (the container name). -func (be *beSwift) Location() string { - return be.container -} - // Hasher may return a hash function for calculating a content hash for the backend func (be *beSwift) Hasher() hash.Hash { return md5.New() diff --git a/internal/backend/test/tests.go b/internal/backend/test/tests.go index 4c260d264..e2879a3bd 100644 --- a/internal/backend/test/tests.go +++ b/internal/backend/test/tests.go @@ -88,17 +88,6 @@ func (s *Suite[C]) TestCreateWithConfig(t *testing.T) { } } -// TestLocation tests that a location string is returned. -func (s *Suite[C]) TestLocation(t *testing.T) { - b := s.open(t) - defer s.close(t, b) - - l := b.Location() - if l == "" { - t.Fatalf("invalid location string %q", l) - } -} - // TestConfig saves and loads a config from the backend. func (s *Suite[C]) TestConfig(t *testing.T) { b := s.open(t)