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

     1  package local
     2  
     3  import (
     4  	"zotregistry.io/zot/pkg/extensions/monitoring"
     5  	zlog "zotregistry.io/zot/pkg/log"
     6  	"zotregistry.io/zot/pkg/storage/cache"
     7  	common "zotregistry.io/zot/pkg/storage/common"
     8  	"zotregistry.io/zot/pkg/storage/imagestore"
     9  	storageTypes "zotregistry.io/zot/pkg/storage/types"
    10  )
    11  
    12  // NewImageStore returns a new image store backed by a file storage.
    13  // Use the last argument to properly set a cache database, or it will default to boltDB local storage.
    14  func NewImageStore(rootDir string, dedupe, commit bool, log zlog.Logger,
    15  	metrics monitoring.MetricServer, linter common.Lint, cacheDriver cache.Cache,
    16  ) storageTypes.ImageStore {
    17  	return imagestore.NewImageStore(
    18  		rootDir,
    19  		rootDir,
    20  		dedupe,
    21  		commit,
    22  		log,
    23  		metrics,
    24  		linter,
    25  		New(commit),
    26  		cacheDriver,
    27  	)
    28  }