feat: 核心模块增强 — 加密 + 运行时配置 + 日志缓冲

- crypto.py: API Key 加密/解密工具
- runtime_config.py: 运行时动态配置管理
- log_buffer.py: 内存日志缓冲区
- config.py: 新增加密配置项
- http_client.py: 增强重试和错误处理
This commit is contained in:
shangfangjian
2026-09-19 11:58:03 +08:00
parent b3e2c52b49
commit 786f10aa11
57 changed files with 3178 additions and 488 deletions
+7 -3
View File
@@ -29,9 +29,13 @@ class DataSource(Protocol):
_SOURCES: dict[str, DataSource] = {}
def register(source: DataSource) -> DataSource:
"""装饰器:将数据源注册到全局注册表。"""
_SOURCES[source.name] = source
def register(source):
"""装饰器:将数据源注册到全局注册表。
兼容类注册与实例注册:类会被实例化后存入(保证 get_source 返回实例)。
"""
obj = source() if isinstance(source, type) else source
_SOURCES[obj.name] = obj
return source