Move conffile_parser from services to utils
This commit is contained in:
@@ -40,8 +40,9 @@ from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import time
|
||||
from collections.abc import Awaitable, Callable
|
||||
from dataclasses import dataclass
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, TypeAlias
|
||||
|
||||
import aiohttp
|
||||
import structlog
|
||||
@@ -118,6 +119,14 @@ class GeoInfo:
|
||||
"""Organisation name associated with the IP, e.g. ``"Deutsche Telekom"``."""
|
||||
|
||||
|
||||
GeoEnricher: TypeAlias = Callable[[str], Awaitable[GeoInfo | None]]
|
||||
"""Async callable used to enrich IPs with :class:`~app.services.geo_service.GeoInfo`.
|
||||
|
||||
This is a shared type alias used by services that optionally accept a geo
|
||||
lookup callable (for example, :mod:`app.services.history_service`).
|
||||
"""
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Internal cache
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user