mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-11-27 10:34:42 -05:00
47 lines
1.5 KiB
Go
47 lines
1.5 KiB
Go
package revaconfig
|
|
|
|
import (
|
|
"github.com/opencloud-eu/opencloud/pkg/storage"
|
|
"github.com/opencloud-eu/opencloud/services/storage-users/pkg/config"
|
|
)
|
|
|
|
// StorageProviderDrivers are the drivers for the storage provider
|
|
func StorageProviderDrivers(cfg *config.Config) map[string]any {
|
|
drivers := map[string]any{
|
|
"eos": EOS(cfg),
|
|
"eoshome": EOSHome(cfg),
|
|
"eosgrpc": EOSGRPC(cfg),
|
|
"local": Local(cfg),
|
|
"localhome": LocalHome(cfg),
|
|
"owncloudsql": OwnCloudSQL(cfg),
|
|
"decomposed": DecomposedNoEvents(cfg),
|
|
"decomposeds3": DecomposedS3NoEvents(cfg),
|
|
"posix": Posix(cfg, cfg.Drivers.Posix.ScanFS, cfg.Drivers.Posix.WatchFS),
|
|
}
|
|
setLegacyMetadataPrefix(cfg.Driver, drivers)
|
|
return drivers
|
|
}
|
|
|
|
// DataProviderDrivers are the drivers for the storage provider
|
|
func DataProviderDrivers(cfg *config.Config) map[string]any {
|
|
drivers := map[string]any{
|
|
"eos": EOS(cfg),
|
|
"eoshome": EOSHome(cfg),
|
|
"eosgrpc": EOSGRPC(cfg),
|
|
"local": Local(cfg),
|
|
"localhome": LocalHome(cfg),
|
|
"owncloudsql": OwnCloudSQL(cfg),
|
|
"decomposed": Decomposed(cfg),
|
|
"decomposeds3": DecomposedS3(cfg),
|
|
"posix": Posix(cfg, false, false),
|
|
}
|
|
setLegacyMetadataPrefix(cfg.Driver, drivers)
|
|
return drivers
|
|
}
|
|
|
|
func setLegacyMetadataPrefix(driver string, drivers map[string]any) {
|
|
if effective := storage.EffectiveDriver(driver); effective != driver {
|
|
drivers[effective].(map[string]any)["metadata_prefix"] = storage.LegacyMetadataPrefix()
|
|
}
|
|
}
|