2020-02-17 13:57:15 -08:00
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
2021-12-04 03:50:58 +00:00
|
|
|
"zotregistry.io/zot/errors"
|
|
|
|
zlog "zotregistry.io/zot/pkg/log"
|
2022-11-03 00:53:08 +02:00
|
|
|
"zotregistry.io/zot/pkg/storage/cache"
|
2020-02-17 13:57:15 -08:00
|
|
|
)
|
|
|
|
|
2022-11-03 00:53:08 +02:00
|
|
|
func Create(dbtype string, parameters interface{}, log zlog.Logger) (cache.Cache, error) {
|
|
|
|
switch dbtype {
|
|
|
|
case "boltdb":
|
|
|
|
{
|
|
|
|
return cache.NewBoltDBCache(parameters, log), nil
|
2020-02-17 13:57:15 -08:00
|
|
|
}
|
2022-11-22 20:29:57 +02:00
|
|
|
case "dynamodb":
|
|
|
|
{
|
|
|
|
return cache.NewDynamoDBCache(parameters, log), nil
|
|
|
|
}
|
2022-11-03 00:53:08 +02:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
return nil, errors.ErrBadConfig
|
2022-04-12 13:01:04 +03:00
|
|
|
}
|
2020-05-27 14:27:35 -07:00
|
|
|
}
|
2020-02-17 13:57:15 -08:00
|
|
|
}
|