zotregistry.io/zot@v1.4.4-0.20231124084042-02a8ed785457/pkg/storage/s3/s3.go (about)

     1  package s3
     2  
     3  import (
     4  	// Add s3 support.
     5  	"github.com/docker/distribution/registry/storage/driver"
     6  	// Load s3 driver.
     7  	_ "github.com/docker/distribution/registry/storage/driver/s3-aws"
     8  
     9  	"zotregistry.io/zot/pkg/extensions/monitoring"
    10  	zlog "zotregistry.io/zot/pkg/log"
    11  	"zotregistry.io/zot/pkg/storage/cache"
    12  	common "zotregistry.io/zot/pkg/storage/common"
    13  	"zotregistry.io/zot/pkg/storage/imagestore"
    14  	storageTypes "zotregistry.io/zot/pkg/storage/types"
    15  )
    16  
    17  // NewObjectStorage returns a new image store backed by cloud storages.
    18  // see https://github.com/docker/docker.github.io/tree/master/registry/storage-drivers
    19  // Use the last argument to properly set a cache database, or it will default to boltDB local storage.
    20  func NewImageStore(rootDir string, cacheDir string, dedupe, commit bool, log zlog.Logger,
    21  	metrics monitoring.MetricServer, linter common.Lint, store driver.StorageDriver, cacheDriver cache.Cache,
    22  ) storageTypes.ImageStore {
    23  	return imagestore.NewImageStore(
    24  		rootDir,
    25  		cacheDir,
    26  		dedupe,
    27  		commit,
    28  		log,
    29  		metrics,
    30  		linter,
    31  		New(store),
    32  		cacheDriver,
    33  	)
    34  }