Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WithSelectedDescriptors API #371

Open
tri-adam opened this issue Jul 4, 2024 · 0 comments
Open

Add WithSelectedDescriptors API #371

tri-adam opened this issue Jul 4, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@tri-adam
Copy link
Member

tri-adam commented Jul 4, 2024

We currently expose WithDescriptors which iterates across all descriptors, and GetDescriptors which use a selection function to return one or more descriptors.

It occurs to me that there are cases where a caller might want to iterate across only selected descriptors. Although this can be accomplished via WithDescriptors or GetDescriptors today, it requires extra legwork on the part of the caller.

I believe it would be trivial enough to add a new API for this, something like:

func (f *FileImage) WithSelectedDescriptors(fn func(d Descriptor) bool, fns ...DescriptorSelectorFunc)
@tri-adam tri-adam added the enhancement New feature or request label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant