mirror of
https://github.com/sot-tech/mochi.git
synced 2026-05-11 06:39:08 -07:00
store: now opening stores
This commit is contained in:
committed by
Jimmy Zelinskie
parent
1dab3978fb
commit
1a4ecb133f
@@ -36,13 +36,10 @@ func RegisterClientStoreDriver(name string, driver ClientStoreDriver) {
|
||||
}
|
||||
|
||||
// OpenClientStore returns a ClientStore specified by a configuration.
|
||||
func OpenClientStore(name string, cfg *Config) (ClientStore, error) {
|
||||
driver, ok := clientStoreDrivers[name]
|
||||
func OpenClientStore(cfg *Config) (ClientStore, error) {
|
||||
driver, ok := clientStoreDrivers[cfg.ClientStore]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf(
|
||||
"store: unknown driver %q (forgotten import?)",
|
||||
name,
|
||||
)
|
||||
return nil, fmt.Errorf("store: unknown driver %q (forgotten import?)", cfg.ClientStore)
|
||||
}
|
||||
|
||||
return driver.New(cfg)
|
||||
|
||||
Reference in New Issue
Block a user