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

Improve StorageInterface, add method get #660

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

Enet4
Copy link
Collaborator

@Enet4 Enet4 commented Jul 21, 2023

This PR proposes a backwards-compatible extension to StorageInterface with default method get. Unlike at, get is designed to retrieve up to a single item in storage, so it does not need file system tree traversal or building up iterables and iterators.

A default implementation is provided that uses at underneath, but implementors may wish to override it for more efficiency.

This PR also includes a few quality-of-life improvements, including some clarifications to other methods in the plugin interface.

Summary

  • Add default method StorageInterface#get, to retrieve a single item from storage
    • update code in core to use it where suitable
    • also correct image servlet to only query for instances to DIM providers if specified
  • Fix example code in at
  • Clarify in list that a trailing forward slash means that it's a directory

- specifically for retrieving a single item from storage,
  without deep file traversal or requiring any iterables
- default impl uses `at` underneath to implement it
- update code in core to use it where suitable
- also correct image servlet to only query for instances
  to DIM providers if specified
- Fix example code in #at
- Clarify in #list that a trailing forward slash
  means that it's a directory
@Enet4 Enet4 requested a review from bastiao July 21, 2023 10:16
@Enet4 Enet4 self-assigned this Jul 21, 2023
Copy link
Member

@bastiao bastiao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that it useful.
I will merge it soon.

@Enet4 Enet4 added this to the 3.4.0 milestone Aug 25, 2023
@Enet4
Copy link
Collaborator Author

Enet4 commented Aug 25, 2023

@bastiao Since the next Dicoogle version is intended to be a patch version, let's keep this PR on hold until we plan to deploy a feature release.

Copy link
Collaborator Author

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might as well fix this typo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants