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

feat: Richer tags api #69

Merged
merged 16 commits into from
Mar 12, 2025
Merged

feat: Richer tags api #69

merged 16 commits into from
Mar 12, 2025

Conversation

rklaehn
Copy link
Collaborator

@rklaehn rklaehn commented Mar 10, 2025

Description

This makes the anemic tags api much more rich

  • Tag deletion
    • delete by range, by prefix, single item, or all 💣
  • Tag listing
    • list by range, prefix or get single item
  • Tag setting
    • set a tag to a value
  • Tag renaming
    • atomic rename, just like for files

Breaking Changes

Breaks the RPC protocol and the store trait

RPC protocol:

  • rpc::proto::tags::DeleteRequest now has from and to field
  • rpc::proto::tags::DeleteRequest no longer has name field
  • rpc::proto::tags::ListRequest now has from and to field
  • rpc::proto::tags::ListRequest::all removed
  • rpc::proto::tags::ListRequest::raw removed
  • rpc::proto::tags::ListRequest::hash_seq removed

Store trait:

  • store::traits::ReadableStore::tags now takes from and to

Notes & open questions

Question: should we enable the rpc feature flag by default? Given that the only way to get the pleasant API at this time is the rpc, and we want beginners to have a good experience? In my big refactor you will be able to get this API without rpc enabled, but for now this is just how it is.

Implements #65

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

Copy link

github-actions bot commented Mar 10, 2025

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh-blobs/pr/69/docs/iroh_blobs/

Last updated: 2025-03-12T13:55:03Z

@rklaehn rklaehn changed the title Add API to get the content of a single tag feat: Add API to get the content of a single tag Mar 10, 2025
@dignifiedquire
Copy link
Collaborator

would be nice to have some tests, to make sure the basics of this work

@rklaehn rklaehn requested a review from dignifiedquire March 11, 2025 11:07
@rklaehn
Copy link
Collaborator Author

rklaehn commented Mar 11, 2025

would be nice to have some tests, to make sure the basics of this work

Yeah, this is why this is a draft. But you like the API?

@rklaehn rklaehn changed the title feat: Add API to get the content of a single tag feat: Richer tags api Mar 11, 2025
@rklaehn
Copy link
Collaborator Author

rklaehn commented Mar 11, 2025

Added some tests

@rklaehn rklaehn marked this pull request as ready for review March 11, 2025 13:07
@sanderpick
Copy link

great to see this 💪

@rklaehn rklaehn merged commit 387c68c into main Mar 12, 2025
23 of 24 checks passed
@rklaehn rklaehn deleted the rich-tags-api branch March 12, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants