@@ -37,9 +37,9 @@ import (
37
37
// defaultConcurrency is the default value of CopyGraphOptions.Concurrency.
38
38
const defaultConcurrency int = 3 // This value is consistent with dockerd and containerd.
39
39
40
- // SkipNode signals to stop copying a descriptor. When returned from PreCopy the blob must exist in the target.
40
+ // SkipNode signals to stop copying a descriptor. When returned from PreCopy the blob must exist in the target.
41
41
// This can be used to signal that a blob has been made available in the target repository by "Mount()" or some other technique.
42
- var SkipNode = errors .New ("skip descriptor " )
42
+ var SkipNode = errors .New ("skip node " )
43
43
44
44
// DefaultCopyOptions provides the default CopyOptions.
45
45
var DefaultCopyOptions CopyOptions = CopyOptions {
@@ -96,7 +96,10 @@ type CopyGraphOptions struct {
96
96
// cached in the memory.
97
97
// If less than or equal to 0, a default (currently 4 MiB) is used.
98
98
MaxMetadataBytes int64
99
- // PreCopy handles the current descriptor before copying it.
99
+ // PreCopy handles the current descriptor before copying it. It returns an
100
+ // oras.SkipNode error if a blob already exists in the target, this means
101
+ // a blob may has been made available in the target repository by "Mount()"
102
+ // or some other technique.
100
103
PreCopy func (ctx context.Context , desc ocispec.Descriptor ) error
101
104
// PostCopy handles the current descriptor after copying it.
102
105
PostCopy func (ctx context.Context , desc ocispec.Descriptor ) error
0 commit comments