35 lines
849 B
Python
35 lines
849 B
Python
from abc import ABC, abstractmethod
|
|
|
|
|
|
class StorageAdapter(ABC):
|
|
def __init__(self, client):
|
|
self.__client = client
|
|
|
|
@abstractmethod
|
|
def make_bucket(self, bucket_name):
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def has_bucket(self, bucket_name):
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def put_object(self, bucket_name, object_name, data):
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def get_object(self, bucket_name, object_name):
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def get_all_objects(self, bucket_name):
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def clear_bucket(self, bucket_name):
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def get_all_object_names(self, bucket_name, prefix=None):
|
|
raise NotImplementedError
|