Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/interface.py
# Copyright (C) 2015-2020 The Software Heritage developers | # Copyright (C) 2015-2020 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from typing import Any, Dict, List, Optional | from typing import Any, Dict, List, Optional | ||||
from typing_extensions import Protocol | |||||
from swh.core.api import remote_api_endpoint | from swh.core.api import remote_api_endpoint | ||||
class StorageInterface: | class StorageInterface(Protocol): | ||||
@remote_api_endpoint('check_config') | @remote_api_endpoint('check_config') | ||||
def check_config(self, *, check_write): | def check_config(self, *, check_write): | ||||
"""Check that the storage is configured and ready to go.""" | """Check that the storage is configured and ready to go.""" | ||||
... | ... | ||||
@remote_api_endpoint('content/add') | @remote_api_endpoint('content/add') | ||||
def content_add(self, content): | def content_add(self, content): | ||||
"""Add content blobs to the storage | """Add content blobs to the storage | ||||
▲ Show 20 Lines • Show All 1,205 Lines • Show Last 20 Lines |