"""传输层抽象基类"""
from abc import ABC, abstractmethod
from typing import List, Dict, Any


class BaseTransport(ABC):
    """传输层抽象基类
    
    定义了传输层的标准接口，支持可插拔的传输协议
    """
    
    @abstractmethod
    def send(self, logs: List[Dict[str, Any]]) -> bool:
        """发送日志批次
        
        Args:
            logs: 日志列表
            
        Returns:
            是否发送成功
        """
        pass
    
    @abstractmethod
    def health_check(self) -> bool:
        """健康检查
        
        Returns:
            服务器是否可达
        """
        pass
    
    @abstractmethod
    def close(self):
        """关闭连接，释放资源"""
        pass
    
    @abstractmethod
    def get_stats(self) -> Dict[str, Any]:
        """获取传输统计信息
        
        Returns:
            统计信息字典
        """
        pass
