backend: split layout code into own subpackage

This commit is contained in:
Michael Eischer
2022-10-15 16:23:39 +02:00
parent b361284f28
commit 4ccd5e806b
14 changed files with 43 additions and 36 deletions

View File

@@ -10,6 +10,7 @@ import (
"time"
"github.com/restic/restic/internal/backend"
"github.com/restic/restic/internal/backend/layout"
"github.com/restic/restic/internal/backend/sema"
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/errors"
@@ -25,7 +26,7 @@ type b2Backend struct {
bucket *b2.Bucket
cfg Config
listMaxItems int
backend.Layout
layout.Layout
sem sema.Semaphore
}
@@ -97,7 +98,7 @@ func Open(ctx context.Context, cfg Config, rt http.RoundTripper) (restic.Backend
client: client,
bucket: bucket,
cfg: cfg,
Layout: &backend.DefaultLayout{
Layout: &layout.DefaultLayout{
Join: path.Join,
Path: cfg.Prefix,
},
@@ -138,7 +139,7 @@ func Create(ctx context.Context, cfg Config, rt http.RoundTripper) (restic.Backe
client: client,
bucket: bucket,
cfg: cfg,
Layout: &backend.DefaultLayout{
Layout: &layout.DefaultLayout{
Join: path.Join,
Path: cfg.Prefix,
},