Skip to content

Conversation

@rosstimothy
Copy link
Contributor

Both the generic.Service and generic.ServiceWrapper have a new Resources(ctx context.Context, startKey, endKey string) iter.Seq2[Resource, error] received method to allow iterating through a range of items stored. Their respective ListResources methods have been updated to use the backend.Items iteration instead of GetRange as well.

This can be utilized by higher layers which want a way to effectively paginate and filter items. For the moment, it is only consumed outside of tests by (PluginStaticCredentialsService) GetPluginStaticCredentialsByLabels but was specifically added to be consumed by some of the scoped resource APIs in the near future.

Both the generic.Service and generic.ServiceWrapper have a new
`Resources(ctx context.Context, startKey, endKey string) iter.Seq2[Resource, error]`
received method to allow iterating through a range of items stored.
Their respective ListResources methods have been updated to use
the backend.Items iteration instead of GetRange as well.

This can be utilized by higher layers which want a way to effectively
paginate and filter items. For the moment, it is only consumed outside
of tests by `(PluginStaticCredentialsService) GetPluginStaticCredentialsByLabels`
but was specifically added to be consumed by some of the scoped resource
APIs in the near future.
@rosstimothy rosstimothy added the no-changelog Indicates that a PR does not require a changelog entry label May 30, 2025
@rosstimothy rosstimothy marked this pull request as ready for review May 30, 2025 14:39
@github-actions github-actions bot requested review from atburke and probakowski May 30, 2025 14:39
@rosstimothy rosstimothy added this pull request to the merge queue Jun 16, 2025
Merged via the queue into master with commit 79b2f26 Jun 16, 2025
46 checks passed
@rosstimothy rosstimothy deleted the tross/generic_service_resources branch June 16, 2025 16:41
bl-nero pushed a commit that referenced this pull request Aug 1, 2025
Both the generic.Service and generic.ServiceWrapper have a new
`Resources(ctx context.Context, startKey, endKey string) iter.Seq2[Resource, error]`
received method to allow iterating through a range of items stored.
Their respective ListResources methods have been updated to use
the backend.Items iteration instead of GetRange as well.

This can be utilized by higher layers which want a way to effectively
paginate and filter items. For the moment, it is only consumed outside
of tests by `(PluginStaticCredentialsService) GetPluginStaticCredentialsByLabels`
but was specifically added to be consumed by some of the scoped resource
APIs in the near future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a PR does not require a changelog entry size/md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants