0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2025-01-06 22:40:28 -05:00
zot/pkg/storage/local/local.go

36 lines
953 B
Go
Raw Normal View History

package local
2021-09-30 08:27:13 -05:00
import (
"time"
"zotregistry.io/zot/pkg/extensions/monitoring"
zlog "zotregistry.io/zot/pkg/log"
"zotregistry.io/zot/pkg/storage/cache"
common "zotregistry.io/zot/pkg/storage/common"
"zotregistry.io/zot/pkg/storage/imagestore"
storageTypes "zotregistry.io/zot/pkg/storage/types"
)
2021-09-30 08:27:13 -05:00
// NewImageStore returns a new image store backed by a file storage.
// Use the last argument to properly set a cache database, or it will default to boltDB local storage.
func NewImageStore(rootDir string, gc bool, gcReferrers bool, gcDelay time.Duration,
untaggedImageRetentionDelay time.Duration, dedupe, commit bool,
log zlog.Logger, metrics monitoring.MetricServer, linter common.Lint, cacheDriver cache.Cache,
) storageTypes.ImageStore {
return imagestore.NewImageStore(
rootDir,
rootDir,
gc,
gcReferrers,
gcDelay,
untaggedImageRetentionDelay,
dedupe,
commit,
log,
metrics,
linter,
New(commit),
cacheDriver,
)
}