diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2017-10-02 14:26:26 +0200 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2017-10-03 15:01:38 +0200 |
commit | db0c023fd0d756912c3f575c6ac65e99fda573cc (patch) | |
tree | f5e507c519f591e401fbb46bb77118d252b37612 /storage/registry/registry.go | |
parent | 7f0771d0a9caf2d3294bfced9e66fac03334d9ba (diff) | |
download | petrific-db0c023fd0d756912c3f575c6ac65e99fda573cc.tar.gz petrific-db0c023fd0d756912c3f575c6ac65e99fda573cc.tar.bz2 petrific-db0c023fd0d756912c3f575c6ac65e99fda573cc.zip |
Add filter storage method
Also remove de/encryption in cloud storage, can be provided with a
filter storage
Diffstat (limited to 'storage/registry/registry.go')
-rw-r--r-- | storage/registry/registry.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/storage/registry/registry.go b/storage/registry/registry.go index f792946..4b48ef4 100644 --- a/storage/registry/registry.go +++ b/storage/registry/registry.go @@ -11,10 +11,13 @@ import ( ) // List af all available storage types -var StorageTypes = map[string]storage.CreateStorageFromConfig{ - "local": local.LocalStorageFromConfig, - "memory": memory.MemoryStorageFromConfig, - "openstack-swift": cloud.SwiftStorageCreator(), +func getStorageTypes() map[string]storage.CreateStorageFromConfig { + return map[string]storage.CreateStorageFromConfig{ + "local": local.LocalStorageFromConfig, + "memory": memory.MemoryStorageFromConfig, + "filter": filterStorageFromConfig, + "openstack-swift": cloud.SwiftStorageCreator(), + } } var notFoundErr = errors.New("Storage not found") @@ -41,7 +44,7 @@ func loadStorage(conf config.Config, storageName string) (storage.Storage, error return nil, err } - st, ok := StorageTypes[method] + st, ok := getStorageTypes()[method] if !ok { return nil, unknownMethodErr(method) } |