0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-23 22:27:35 -05:00
zot/pkg/storage/cache.go
Catalin-George Hofnar 31b9481713
feat(cache): dynamodb implementation (#953)
Signed-off-by: Catalin Hofnar <catalin.hofnar@gmail.com>
2022-11-22 10:29:57 -08:00

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
}
}
}