b5a62ee9a3
- domain: User, Workspace, Project, AssetLibrary, Asset, IngestJob - ports: repository interfaces - application: use cases - adapters: in-memory - API: FastAPI 5 routes - worker: Celery ingest_asset - tests: 4 passing
29 lines
711 B
Python
29 lines
711 B
Python
from functools import lru_cache
|
|
|
|
from packages.adapters.in_memory import (
|
|
InMemoryAssetLibraryRepository,
|
|
InMemoryAssetRepository,
|
|
InMemoryIngestJobRepository,
|
|
InMemoryProjectRepository,
|
|
)
|
|
|
|
|
|
@lru_cache(maxsize=1)
|
|
def get_project_repository() -> InMemoryProjectRepository:
|
|
return InMemoryProjectRepository()
|
|
|
|
|
|
@lru_cache(maxsize=1)
|
|
def get_asset_library_repository() -> InMemoryAssetLibraryRepository:
|
|
return InMemoryAssetLibraryRepository()
|
|
|
|
|
|
@lru_cache(maxsize=1)
|
|
def get_asset_repository() -> InMemoryAssetRepository:
|
|
return InMemoryAssetRepository()
|
|
|
|
|
|
@lru_cache(maxsize=1)
|
|
def get_ingest_job_repository() -> InMemoryIngestJobRepository:
|
|
return InMemoryIngestJobRepository()
|