diff --git a/copy.go b/copy.go index 2f131a8c..adc30cb4 100644 --- a/copy.go +++ b/copy.go @@ -120,8 +120,11 @@ type CopyGraphOptions struct { FindSuccessors func(ctx context.Context, fetcher content.Fetcher, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) } -// Copy copies a rooted directed acyclic graph (DAG) with the tagged root node -// in the source Target to the destination Target. +// Copy copies a rooted directed acyclic graph (DAG), such as an artifact, +// from the source Target to the destination Target. +// +// The root node (e.g. a tagged manifest of the artifact) is identified by the +// source reference. // The destination reference will be the same as the source reference if the // destination reference is left blank. // @@ -167,8 +170,9 @@ func Copy(ctx context.Context, src ReadOnlyTarget, srcRef string, dst Target, ds return root, nil } -// CopyGraph copies a rooted directed acyclic graph (DAG) from the source CAS to -// the destination CAS. +// CopyGraph copies a rooted directed acyclic graph (DAG), such as an artifact, +// from the source CAS to the destination CAS. +// The root node (e.g. a manifest of the artifact) is identified by a descriptor. func CopyGraph(ctx context.Context, src content.ReadOnlyStorage, dst content.Storage, root ocispec.Descriptor, opts CopyGraphOptions) error { return copyGraph(ctx, src, dst, root, nil, nil, nil, opts) } diff --git a/extendedcopy.go b/extendedcopy.go index 49b6264e..cde9f1a1 100644 --- a/extendedcopy.go +++ b/extendedcopy.go @@ -65,6 +65,11 @@ type ExtendedCopyGraphOptions struct { // ExtendedCopy copies the directed acyclic graph (DAG) that are reachable from // the given tagged node from the source GraphTarget to the destination Target. +// In other words, it copies an tagged artifact along with its referrers or +// other predecessor manifests referencing it. +// +// The tagged node (e.g. a tagged manifest of the artifact) is identified by the +// source reference. // The destination reference will be the same as the source reference if the // destination reference is left blank. // @@ -98,6 +103,9 @@ func ExtendedCopy(ctx context.Context, src ReadOnlyGraphTarget, srcRef string, d // ExtendedCopyGraph copies the directed acyclic graph (DAG) that are reachable // from the given node from the source GraphStorage to the destination Storage. +// In other words, it copies an artifact along with its referrers or other +// predecessor manifests referencing it. +// The node (e.g. a manifest of the artifact) is identified by a descriptor. func ExtendedCopyGraph(ctx context.Context, src content.ReadOnlyGraphStorage, dst content.Storage, node ocispec.Descriptor, opts ExtendedCopyGraphOptions) error { roots, err := findRoots(ctx, src, node, opts) if err != nil {