Cached scan result.
| 16 | |
| 17 | |
| 18 | class CacheEntry(BaseModel): |
| 19 | """Cached scan result.""" |
| 20 | target: str |
| 21 | modules: list[str] |
| 22 | result_data: dict |
| 23 | created_at: datetime |
| 24 | expires_at: datetime |
| 25 | checksum: str |
| 26 | |
| 27 | def is_expired(self) -> bool: |
| 28 | """Check if cache entry has expired.""" |
| 29 | return datetime.now(timezone.utc) >= self.expires_at |
| 30 | |
| 31 | def __hash__(self) -> str: |
| 32 | """Get cache entry hash.""" |
| 33 | return self.checksum |
| 34 | |
| 35 | |
| 36 | class ScanCache: |
no outgoing calls