From 23e3d553e6956a68cbd09378d373e265d484be2b Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Mon, 23 Jan 2023 13:43:18 +0000 Subject: [PATCH] feature(backups): placeholders for the backupers and backup providers --- selfprivacy_api/backup/__init__.py | 5 +++++ selfprivacy_api/backup/providers/backblaze.py | 6 ++++++ selfprivacy_api/backup/providers/provider.py | 13 +++++++++++++ selfprivacy_api/backup/restic_backuper.py | 6 ++++++ 4 files changed, 30 insertions(+) create mode 100644 selfprivacy_api/backup/restic_backuper.py diff --git a/selfprivacy_api/backup/__init__.py b/selfprivacy_api/backup/__init__.py index e69de29..ff9bb2d 100644 --- a/selfprivacy_api/backup/__init__.py +++ b/selfprivacy_api/backup/__init__.py @@ -0,0 +1,5 @@ +from abc import ABC + +class AbstractBackuper(ABC): + def __init__(self): + pass \ No newline at end of file diff --git a/selfprivacy_api/backup/providers/backblaze.py b/selfprivacy_api/backup/providers/backblaze.py index e69de29..6dfa1a7 100644 --- a/selfprivacy_api/backup/providers/backblaze.py +++ b/selfprivacy_api/backup/providers/backblaze.py @@ -0,0 +1,6 @@ +from .provider import AbstractBackupProvider +from selfprivacy_api.backup.restic_backuper import ResticBackuper + + +class Backblaze(AbstractBackupProvider): + backuper = ResticBackuper() diff --git a/selfprivacy_api/backup/providers/provider.py b/selfprivacy_api/backup/providers/provider.py index e69de29..9bd8a60 100644 --- a/selfprivacy_api/backup/providers/provider.py +++ b/selfprivacy_api/backup/providers/provider.py @@ -0,0 +1,13 @@ +""" +An abstract class for BackBlaze, S3 etc. +It assumes that while some providers are supported via restic/rclone, others may +require different backends +""" +from abc import ABC +from selfprivacy_api.backup import AbstractBackuper + + +class AbstractBackupProvider(ABC): + @property + def backuper(self) -> AbstractBackuper: + raise NotImplementedError diff --git a/selfprivacy_api/backup/restic_backuper.py b/selfprivacy_api/backup/restic_backuper.py new file mode 100644 index 0000000..f1775ff --- /dev/null +++ b/selfprivacy_api/backup/restic_backuper.py @@ -0,0 +1,6 @@ +from selfprivacy_api.backup import AbstractBackuper + + +class ResticBackuper(AbstractBackuper): + def __init__(self): + pass