Backend: Expose connections parameter

This commit is contained in:
Michael Eischer committed 2022-04-23 11:13:08 +02:00
1 parent 07a565e6f7
commit 4f97492d28
10 files changed
+83 -31

No files matched your search

+13 -7
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