Skip to content

refactor(client): 拆分 HTTP 客户端,分离嵌入模式与 HTTP 模式#141

Merged
MaojiaSheng merged 2 commits intomainfrom
refactor/httpclient
Feb 12, 2026
Merged

refactor(client): 拆分 HTTP 客户端,分离嵌入模式与 HTTP 模式#141
MaojiaSheng merged 2 commits intomainfrom
refactor/httpclient

Conversation

@qin-ctx
Copy link
Collaborator

@qin-ctx qin-ctx commented Feb 12, 2026

Description

拆分 HTTP 客户端为独立的 AsyncHTTPClient / SyncHTTPClient,与嵌入模式 (AsyncOpenViking / SyncOpenViking) 彻底分离,简化架构并消除模式混用。

Related Issue

N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • 将 HTTPClient 重命名为 AsyncHTTPClient,新增 SyncHTTPClient 同步封装
  • AsyncOpenViking / SyncOpenViking 仅保留嵌入模式,移除 url、api_key、user 参数
  • AsyncHTTPClient 支持从 ovcli.conf 自动加载 url / api_key(未显式传入时)
  • 移除所有客户端构造函数中的 user 参数,统一使用默认用户
  • 简化 CLIContext,直接使用 SyncHTTPClient 替代 SyncOpenViking
  • 简化 VikingFS._uri_to_path 实现
  • search() 方法新增 session 参数,支持直接传入 Session 对象
  • 更新中英文文档、示例代码和全部测试用例适配新 API

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

N/A

Additional Notes

这是一个 Breaking Change:

  • AsyncOpenViking(url=...) 不再支持,HTTP 模式请改用 AsyncHTTPClient 或 SyncHTTPClient
  • 客户端构造函数不再接受 user 参数

- 将 HTTPClient 重命名为 AsyncHTTPClient,新增 SyncHTTPClient 同步封装
- AsyncOpenViking/SyncOpenViking 仅保留嵌入模式,HTTP 模式使用独立的 AsyncHTTPClient/SyncHTTPClient
- HTTP 客户端支持从 ovcli.conf 自动加载 url/api_key
- 移除客户端构造函数中的 user 参数,统一使用默认用户
- 简化 CLIContext,直接使用 SyncHTTPClient
- 简化 VikingFS._uri_to_path 实现
- 更新文档、示例和测试适配新 API
@CLAassistant
Copy link

CLAassistant commented Feb 12, 2026

CLA assistant check
All committers have signed the CLA.

@MaojiaSheng MaojiaSheng merged commit 002e140 into main Feb 12, 2026
2 of 5 checks passed
@MaojiaSheng MaojiaSheng deleted the refactor/httpclient branch February 12, 2026 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants