Changeset View
Changeset View
Standalone View
Standalone View
swh/provenance/mongo/storage.py
- This file was added.
from datetime import datetime | |||||
from typing import Dict, Generator, Iterable, Optional, Set, Tuple | |||||
from swh.model.model import Sha1Git | |||||
from ..interface import ( | |||||
EntityType, | |||||
ProvenanceResult, | |||||
RelationData, | |||||
RelationType, | |||||
RevisionData, | |||||
) | |||||
class ProvenanceStorageMongoDB: | |||||
def content_find_first(self, key: Sha1Git) -> Optional[ProvenanceResult]: | |||||
return None | |||||
def content_find_all(self, key): | |||||
... | |||||
def content_get(self, ids: Iterable[Sha1Git]) -> Dict[Sha1Git, datetime]: | |||||
return True | |||||
def directory_set_date(self, dates: Dict[Sha1Git, datetime]) -> bool: | |||||
return True | |||||
def directory_get(self, ids: Iterable[Sha1Git]) -> Dict[Sha1Git, datetime]: | |||||
return None | |||||
def entity_get_all(self, entity: EntityType) -> Set[Sha1Git]: | |||||
return None | |||||
def location_get(self) -> Set[bytes]: | |||||
return None | |||||
def origin_set_url(self, urls: Dict[Sha1Git, str]) -> bool: | |||||
return True | |||||
def origin_get(self, ids: Iterable[Sha1Git]) -> Dict[Sha1Git, str]: | |||||
return None | |||||
def revision_set_date(self, dates: Dict[Sha1Git, datetime]) -> bool: | |||||
return True | |||||
def revision_set_origin(self, origins: Dict[Sha1Git, Sha1Git]) -> bool: | |||||
return True | |||||
def revision_get(self, ids: Iterable[Sha1Git]) -> Dict[Sha1Git, RevisionData]: | |||||
return None | |||||
def relation_add( | |||||
self, relation: RelationType, data: Iterable[RelationData] | |||||
) -> bool: | |||||
return True | |||||
def relation_get( | |||||
self, relation: RelationType, ids: Iterable[Sha1Git], reverse: bool = False | |||||
) -> Set[RelationData]: | |||||
return None | |||||
def relation_get_all(self, relation: RelationType) -> Set[RelationData]: | |||||
return None | |||||
def with_path(self) -> bool: | |||||
return True |