mirror of
https://github.com/project-zot/zot.git
synced 2024-12-23 22:27:35 -05:00
31b9481713
Signed-off-by: Catalin Hofnar <catalin.hofnar@gmail.com>
24 lines
457 B
Go
24 lines
457 B
Go
package storage
|
|
|
|
import (
|
|
"zotregistry.io/zot/errors"
|
|
zlog "zotregistry.io/zot/pkg/log"
|
|
"zotregistry.io/zot/pkg/storage/cache"
|
|
)
|
|
|
|
func Create(dbtype string, parameters interface{}, log zlog.Logger) (cache.Cache, error) {
|
|
switch dbtype {
|
|
case "boltdb":
|
|
{
|
|
return cache.NewBoltDBCache(parameters, log), nil
|
|
}
|
|
case "dynamodb":
|
|
{
|
|
return cache.NewDynamoDBCache(parameters, log), nil
|
|
}
|
|
default:
|
|
{
|
|
return nil, errors.ErrBadConfig
|
|
}
|
|
}
|
|
}
|