feat(backup): add in-memory backup

This commit is contained in:
Houkime 2023-02-03 18:29:45 +00:00
parent 5fd7b6c4ed
commit 83ed93b271
2 changed files with 7 additions and 2 deletions

View file

@ -2,10 +2,13 @@ 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.BACKBLAZE: Backblaze,
BackupProvider.MEMORY: InMemoryBackup,
}
def get_provider(provider_type: BackupProvider) -> AbstractBackupProvider:
return PROVIDER_MAPPING[provider_type]

View file

@ -18,3 +18,5 @@ class ServerProvider(Enum):
@strawberry.enum
class BackupProvider(Enum):
BACKBLAZE = "BACKBLAZE"
# for testing purposes, make sure not selectable in prod.
MEMORY = "MEMORY"