Backend: Expose connections parameter

This commit is contained in:
Michael Eischer
2021-08-07 22:20:49 +02:00
parent 07a565e6f7
commit 4f97492d28
10 changed files with 83 additions and 31 deletions

View File

@@ -24,10 +24,11 @@ import (
// beSwift is a backend which stores the data on a swift endpoint.
type beSwift struct {
conn *swift.Connection
sem *backend.Semaphore
container string // Container name
prefix string // Prefix of object names in the container
conn *swift.Connection
connections uint
sem *backend.Semaphore
container string // Container name
prefix string // Prefix of object names in the container
backend.Layout
}
@@ -68,9 +69,10 @@ func Open(ctx context.Context, cfg Config, rt http.RoundTripper) (restic.Backend
Transport: rt,
},
sem: sem,
container: cfg.Container,
prefix: cfg.Prefix,
connections: cfg.Connections,
sem: sem,
container: cfg.Container,
prefix: cfg.Prefix,
Layout: &backend.DefaultLayout{
Path: cfg.Prefix,
Join: path.Join,
@@ -113,6 +115,10 @@ func (be *beSwift) createContainer(ctx context.Context, policy string) error {
return be.conn.ContainerCreate(ctx, be.container, h)
}
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