store: now opening stores

This commit is contained in:
Leo Balduf
2016-02-16 21:47:40 +01:00
committed by Jimmy Zelinskie
parent 1dab3978fb
commit 1a4ecb133f
3 changed files with 26 additions and 14 deletions

View File

@@ -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)