0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00
zot/pkg/storage/cache.go

25 lines
457 B
Go
Raw Normal View History

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