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

Support namespace API #67

Closed
tisonkun opened this issue Nov 13, 2023 · 7 comments · Fixed by #71
Closed

Support namespace API #67

tisonkun opened this issue Nov 13, 2023 · 7 comments · Fixed by #71

Comments

@tisonkun
Copy link
Contributor

It's convenient to put/get keys in a "namespace" for separating different usage, or it's even required to smoothly write concurrent tests share the same etcd cluster.

This concept, in ZooKeeper, is named as Chroot. I don't find it in etcd but it should be a client-side feature. I create this issue for discussing whether it's desired to implement in this crate.

The API should affect only the constructors for accepting a chroot parameter/options:

Client::connect(endpoints, chroot /* String */, options);
Client::connect(endpoints, options); // chroot in options

... and all the keys pass to this client will be prepended with the "chroot".

@davidli2010
Copy link
Contributor

davidli2010 commented Nov 19, 2023

This crate is just an etcd api wrapper, it does not support features that etcd not support. If chroot is a client-side feature, then you can implement a KeyWrapper in your application.

@tisonkun
Copy link
Contributor Author

Make sense. I'll wrap it in the application :D

@tisonkun tisonkun closed this as not planned Won't fix, can't repro, duplicate, stale Nov 19, 2023
@tisonkun
Copy link
Contributor Author

And I found that #68 is useful to support this feature in client-side - may you take a look? #68 should be in the scope of this project.

@davidli2010
Copy link
Contributor

And I found that #68 is useful to support this feature in client-side - may you take a look? #68 should be in the scope of this project.

I have already reviewed it.

@tisonkun
Copy link
Contributor Author

@davidli2010 a possible argue is that etcd's client library implement namespace which is exactly what proposed here.

Do you think the namespace API is reasonable to be in the scope of this crate?

Ref - https://github.com/etcd-io/etcd/blob/v3.5.10/client/v3/namespace/doc.go

@davidli2010
Copy link
Contributor

@davidli2010 a possible argue is that etcd's client library implement namespace which is exactly what proposed here.

Do you think the namespace API is reasonable to be in the scope of this crate?

Ref - https://github.com/etcd-io/etcd/blob/v3.5.10/client/v3/namespace/doc.go

I'd like to reivew a PR of the namespace API.

@tisonkun
Copy link
Contributor Author

tisonkun commented Nov 22, 2023

@davidli2010 Thanks for your reply! Then let's reopen this issue first, as it's valid.

I'll try to implement it, but it's not on my priority task list, so anyone please feel free to take it over.

@tisonkun tisonkun reopened this Nov 22, 2023
@davidli2010 davidli2010 changed the title Support chroot Support namespace API Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants