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: add api to get tag info by name #65

Closed
dignifiedquire opened this issue Mar 7, 2025 · 1 comment
Closed

feat: add api to get tag info by name #65

dignifiedquire opened this issue Mar 7, 2025 · 1 comment
Assignees
Milestone

Comments

@dignifiedquire
Copy link
Collaborator

Need sth like

let tag = blobs_client.tags().get(b"my tag").await?;

to get the hash belonging to a tag, and to know if such a tag exists.

@n0bot n0bot bot added this to iroh Mar 7, 2025
@rklaehn rklaehn mentioned this issue Mar 10, 2025
4 tasks
@rklaehn rklaehn moved this to 🏗 In progress in iroh Mar 10, 2025
@rklaehn rklaehn added this to the v0.34.0 milestone Mar 10, 2025
@rklaehn
Copy link
Collaborator

rklaehn commented Mar 11, 2025

Implemented in #69

@rklaehn rklaehn moved this from 🏗 In progress to 👀 In review in iroh Mar 11, 2025
@rklaehn rklaehn self-assigned this Mar 11, 2025
rklaehn added a commit that referenced this issue Mar 12, 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

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in iroh Mar 24, 2025
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

No branches or pull requests

3 participants