User Story
As a user of oras-go I would like to discover referrers of a manifest and filter by ArtifactType. I have a GraphStorage which only gives me access to Predecessors. I'd like to take advantage of the referrers API for optimization.
Limits of Current Functionality
The FilterArtifactType option for ExtendedCopyGraph provides this filtering, but the condition of copying limits its use.
As the GraphStorage I have is originally a registry.Repository, I have the option of elevating my GraphStorage to a registry.Repository giving me access to repository.Referrers. However, this has a side effect on my unit tests which use a memory.Store; a PredecessorFinder not a registry.ReferrerLister.
The implementation of func (opts *ExendedCopyGraphOptions) FilterArtifactType(regex) provides a "fallback" mechanism, where a non registry.ReferrerLister uses Predecessors instead, which seems useful to both the memory.Store in my unit tests as well as my GraphStorage.
User Story
As a user of oras-go I would like to discover referrers of a manifest and filter by ArtifactType. I have a
GraphStoragewhich only gives me access toPredecessors. I'd like to take advantage of the referrers API for optimization.Limits of Current Functionality
The
FilterArtifactTypeoption forExtendedCopyGraphprovides this filtering, but the condition of copying limits its use.As the
GraphStorageI have is originally aregistry.Repository, I have the option of elevating myGraphStorageto aregistry.Repositorygiving me access torepository.Referrers. However, this has a side effect on my unit tests which use amemory.Store; aPredecessorFindernot aregistry.ReferrerLister.The implementation of
func (opts *ExendedCopyGraphOptions) FilterArtifactType(regex)provides a "fallback" mechanism, where a nonregistry.ReferrerListerusesPredecessorsinstead, which seems useful to both thememory.Storein my unit tests as well as myGraphStorage.