2022-09-30 12:35:16 -05:00
|
|
|
package local
|
2021-09-30 08:27:13 -05:00
|
|
|
|
|
|
|
import (
|
2024-01-31 23:34:07 -05:00
|
|
|
"zotregistry.dev/zot/pkg/extensions/monitoring"
|
|
|
|
zlog "zotregistry.dev/zot/pkg/log"
|
|
|
|
"zotregistry.dev/zot/pkg/storage/cache"
|
|
|
|
common "zotregistry.dev/zot/pkg/storage/common"
|
|
|
|
"zotregistry.dev/zot/pkg/storage/imagestore"
|
|
|
|
storageTypes "zotregistry.dev/zot/pkg/storage/types"
|
2023-08-19 00:52:03 -05:00
|
|
|
)
|
|
|
|
|
2021-09-30 08:27:13 -05:00
|
|
|
// NewImageStore returns a new image store backed by a file storage.
|
2022-11-02 17:53:08 -05:00
|
|
|
// Use the last argument to properly set a cache database, or it will default to boltDB local storage.
|
2023-09-22 13:51:20 -05:00
|
|
|
func NewImageStore(rootDir string, dedupe, commit bool, log zlog.Logger,
|
|
|
|
metrics monitoring.MetricServer, linter common.Lint, cacheDriver cache.Cache,
|
2023-05-26 13:08:19 -05:00
|
|
|
) storageTypes.ImageStore {
|
2023-09-01 12:54:39 -05:00
|
|
|
return imagestore.NewImageStore(
|
|
|
|
rootDir,
|
|
|
|
rootDir,
|
|
|
|
dedupe,
|
|
|
|
commit,
|
|
|
|
log,
|
|
|
|
metrics,
|
|
|
|
linter,
|
|
|
|
New(commit),
|
|
|
|
cacheDriver,
|
|
|
|
)
|
2023-04-07 11:49:24 -05:00
|
|
|
}
|