suna/backend/credentials/repositories/base.py

18 lines
409 B
Python
Raw Normal View History

2025-07-14 18:36:27 +08:00
from abc import ABC, abstractmethod
from typing import TypeVar, Generic, List, Optional
T = TypeVar('T')
class Repository(ABC, Generic[T]):
@abstractmethod
async def find_by_id(self, entity_id: str) -> Optional[T]:
pass
@abstractmethod
async def save(self, entity: T) -> T:
pass
@abstractmethod
async def delete(self, entity_id: str) -> bool:
pass