Initial commit - Trekker V2 source
This commit is contained in:
commit
d71faf19e3
65 files changed
+3615
No files matched your search
+32
@@ -0,0 +1,32 @@
|
||||
"""Shared singletons wired at startup (store, services)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from functools import lru_cache
|
||||
|
||||
from app.config import settings
|
||||
from app.services.elevation import ElevationService
|
||||
from app.services.llm import LLMService
|
||||
from app.services.offline_maps import OfflineMapService
|
||||
from app.storage.database import connect
|
||||
from app.storage.route_store import Store
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def get_store() -> Store:
|
||||
return Store(connect(settings.db_path))
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def get_llm() -> LLMService:
|
||||
return LLMService(settings.llm)
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def get_elevation() -> ElevationService:
|
||||
return ElevationService()
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def get_offline_maps() -> OfflineMapService:
|
||||
return OfflineMapService(get_store())
|
||||
Reference in new issue
Block a user