selfprivacy-rest-api/selfprivacy_api/backup/providers/__init__.py
2023-05-17 20:27:40 +00:00

15 lines
507 B
Python

from selfprivacy_api.graphql.queries.providers import BackupProvider
from selfprivacy_api.backup.providers.provider import AbstractBackupProvider
from selfprivacy_api.backup.providers.backblaze import Backblaze
from selfprivacy_api.backup.providers.memory import InMemoryBackup
PROVIDER_MAPPING = {
BackupProvider.BACKBLAZE: Backblaze,
BackupProvider.MEMORY: InMemoryBackup,
}
def get_provider(provider_type: BackupProvider) -> AbstractBackupProvider:
return PROVIDER_MAPPING[provider_type]