mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-06-11 20:58:29 +03:00
20 lines
439 B
Python
20 lines
439 B
Python
from abc import ABC, abstractmethod
|
|
|
|
|
|
class Storage(ABC):
|
|
@abstractmethod
|
|
def __init__(self, config): pass
|
|
|
|
@abstractmethod
|
|
def get_cdn_url(self, path): pass
|
|
|
|
@abstractmethod
|
|
def exists(self, path): pass
|
|
|
|
@abstractmethod
|
|
def uploadf(self, file, key, **kwargs): pass
|
|
|
|
def upload(self, filename: str, key: str, **kwargs):
|
|
with open(filename, 'rb') as f:
|
|
self.uploadf(f, key, **kwargs)
|