Skip to content

feat(copy.go): add copy options#7707

Open
FrankYang0529 wants to merge 1 commit into
apache:mainfrom
FrankYang0529:opendal-7706
Open

feat(copy.go): add copy options#7707
FrankYang0529 wants to merge 1 commit into
apache:mainfrom
FrankYang0529:opendal-7706

Conversation

@FrankYang0529
Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes #7706

Rationale for this change

The Rust core already supports Operator::copy_with() with options like if_not_exists, if_match, source_version, source_content_length_hint, concurrent, and chunk, but the C and Go bindings only expose the basic Operator::copy() without any options. This PR exposes the full copy options API in both bindings.

What changes are included in this PR?

C binding

  • Added opendal_copy_options struct with new/free/setter functions for all copy options
  • Added opendal_operator_copy_with() for blocking copy with options
  • Added copy-related capability fields to opendal_capability: copy_with_if_not_exists, copy_with_if_match, copy_with_source_version, copy_can_multi, copy_multi_max_size, copy_multi_min_size

Go binding

  • Added copy.go with functional options: CopyWithIfNotExists, CopyWithIfMatch, CopyWithSourceVersion, CopyWithSourceContentLengthHint, CopyWithConcurrent, CopyWithChunk
  • Extended Operator.Copy() to accept optional copy options
  • Added copy-related capability accessors to Capability: CopyWithIfNotExists, CopyWithIfMatch, CopyWithSourceVersion, CopyCanMulti, CopyMultiMinSize, CopyMultiMaxSize

Are there any user-facing changes?

Yes. C and Go binding users can now use copy options that were previously only available in Rust.

AI Usage Statement

OpenCode with GLM-5.1

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels Jun 7, 2026
Signed-off-by: PoAn Yang <payang@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

new feature: add copy options for C and Go bindings

1 participant