Skip to content

Conversation

jackcipher
Copy link

@jackcipher jackcipher commented Aug 8, 2025

变更背景

在使用 ‎Copy() API 时,通过 ‎CopyWithRawSrcKey() option,可以让业务在跨桶复制场景下,直接指定包含 bucket 信息的原始 key。由于每个 client 实例与单独的 bucket 绑定,未使用 ‎CopyWithRawSrcKey() 时,无法在同一个 client 内获取多个 bucket 的 key。
虽然业务层可以指定带有 bucket 的 rawKey,但原有 client 实现没有暴露获取带前缀 key 的方法,导致无法获取完整的 raw key 路径。

主要变更

• 新增 ‎GetRawSrcKey(ctx, key) 到 ‎Client 接口。
• 在 S3 和 OSS 实现中补充该方法,返回 ‎/<bucket>/<prefixed-key> 格式的完整路径。

影响评估

• 纯新增,向后兼容,不影响现有功能。
• 方便业务层获取 bucket + key 的完整路径,便于应对复杂的跨桶复制场景。

@sevennt sevennt self-assigned this Aug 8, 2025
@sevennt
Copy link

sevennt commented Aug 8, 2025

需要补充一下测试用例,测试用例要考虑带 prefix 和不带 prefix、sharding bucket 和 非 sharding bucket 等情况

@sevennt sevennt added the enhancement New feature or request label Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants