Skip to content

feat(binding/go): Add Copier#7732

Open
FrankYang0529 wants to merge 2 commits into
apache:mainfrom
FrankYang0529:opendal-7731
Open

feat(binding/go): Add Copier#7732
FrankYang0529 wants to merge 2 commits into
apache:mainfrom
FrankYang0529:opendal-7731

Conversation

@FrankYang0529

Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes #7731

Rationale for this change

Rust core exposes Operator::copier() (a Copier handle that drives a long-running copy step by step), but it was missing from both the C and Go bindings, so Go users only had the one-shot Operator.Copy. This adds it.

What changes are included in this PR?

  • C binding: opendal_operator_copier / opendal_operator_copier_with, plus an opendal_copier handle with opendal_copier_next / _abort / _free and matching result types.
  • Go binding: a Copier type with Operator.Copier(src, dest, ...), Next() (uint, bool, error), Abort() and Close(). Copy-option building is refactored into a shared helper reused by both Copy and Copier.

Are there any user-facing changes?

New Operator.Copier API in the Go binding (and the underlying opendal_operator_copier* C functions). No breaking changes.

AI Usage Statement

Claude Code with Opus 4.8.

Signed-off-by: PoAn Yang <payang@apache.org>
@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 11, 2026
Comment thread bindings/go/copier.go
}
defer ffiCopyOptionsFree.symbol(op.ctx)(cOpts)
inner, err := ffiOperatorCopierWith.symbol(op.ctx)(op.inner, src, dest, cOpts)
runtime.KeepAlive(keepAlive)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why do we need this?

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: support Copier in the Go binding

2 participants