Skip to content

Commit

Permalink
resolved comments
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
  • Loading branch information
wangxiaoxuan273 committed Nov 20, 2023
1 parent 8efca6a commit dff6b51
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import (
// defaultConcurrency is the default value of CopyGraphOptions.Concurrency.
const defaultConcurrency int = 3 // This value is consistent with dockerd and containerd.

// SkipNode signals to stop copying a descriptor. When returned from PreCopy the blob must exist in the target.
// SkipNode signals to stop copying a descriptor. When returned from PreCopy the blob must exist in the target.
// This can be used to signal that a blob has been made available in the target repository by "Mount()" or some other technique.
var SkipNode = errors.New("skip descriptor")
var SkipNode = errors.New("skip node")

// DefaultCopyOptions provides the default CopyOptions.
var DefaultCopyOptions CopyOptions = CopyOptions{
Expand Down Expand Up @@ -96,7 +96,10 @@ type CopyGraphOptions struct {
// cached in the memory.
// If less than or equal to 0, a default (currently 4 MiB) is used.
MaxMetadataBytes int64
// PreCopy handles the current descriptor before copying it.
// PreCopy handles the current descriptor before copying it. It returns an
// oras.SkipNode error if a blob already exists in the target, this means
// a blob may has been made available in the target repository by "Mount()"
// or some other technique.
PreCopy func(ctx context.Context, desc ocispec.Descriptor) error
// PostCopy handles the current descriptor after copying it.
PostCopy func(ctx context.Context, desc ocispec.Descriptor) error
Expand Down

0 comments on commit dff6b51

Please sign in to comment.