Load store from config name

This commit is contained in:
Dan Jones 2024-09-15 12:37:42 -05:00
commit c703a26c10
2 changed files with 14 additions and 0 deletions

View file

@ -26,6 +26,10 @@ func GetFactory(name string) StoreFactory {
}
func MakeStore(name string, conf config.Config) (Store, error) {
if name == "" {
name = conf.Conn.Store
}
f, ok := factories[name]
if !ok {
return nil, fmt.Errorf("%w: %s", ErrNoFactory, name)