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,6 +24,7 @@ import (
type Backend struct {
accountName string
container *storage.Container
connections uint
sem *backend.Semaphore
prefix string
listMaxItems int
@@ -55,6 +56,7 @@ func open(cfg Config, rt http.RoundTripper) (*Backend, error) {
be := &Backend{
container: service.GetContainerReference(cfg.Container),
accountName: cfg.AccountName,
connections: cfg.Connections,
sem: sem,
prefix: cfg.Prefix,
Layout: &backend.DefaultLayout{
@@ -109,6 +111,10 @@ func (be *Backend) Join(p ...string) string {
return path.Join(p...)
}
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.container.Name, be.prefix)