mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-25 21:41:27 +00:00
feat(backup): add in-memory backup
This commit is contained in:
parent
e5a965ea29
commit
37c18ead99
|
@ -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:
|
||||
|
||||
def get_provider(provider_type: BackupProvider) -> AbstractBackupProvider:
|
||||
return PROVIDER_MAPPING[provider_type]
|
||||
|
|
|
@ -19,3 +19,5 @@ class ServerProvider(Enum):
|
|||
@strawberry.enum
|
||||
class BackupProvider(Enum):
|
||||
BACKBLAZE = "BACKBLAZE"
|
||||
# for testing purposes, make sure not selectable in prod.
|
||||
MEMORY = "MEMORY"
|
||||
|
|
Loading…
Reference in a new issue