mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-12-01 02:49:29 +00:00
feat(backup): add in-memory backup
This commit is contained in:
parent
5fd7b6c4ed
commit
83ed93b271
|
@ -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.provider import AbstractBackupProvider
|
||||||
|
|
||||||
from selfprivacy_api.backup.providers.backblaze import Backblaze
|
from selfprivacy_api.backup.providers.backblaze import Backblaze
|
||||||
|
from selfprivacy_api.backup.providers.memory import InMemoryBackup
|
||||||
|
|
||||||
PROVIDER_MAPPING = {
|
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]
|
return PROVIDER_MAPPING[provider_type]
|
||||||
|
|
|
@ -18,3 +18,5 @@ class ServerProvider(Enum):
|
||||||
@strawberry.enum
|
@strawberry.enum
|
||||||
class BackupProvider(Enum):
|
class BackupProvider(Enum):
|
||||||
BACKBLAZE = "BACKBLAZE"
|
BACKBLAZE = "BACKBLAZE"
|
||||||
|
# for testing purposes, make sure not selectable in prod.
|
||||||
|
MEMORY = "MEMORY"
|
||||||
|
|
Loading…
Reference in a new issue