shubhamranjan / dotnet-etcd

A C# .NET (dotnet) GRPC client for etcd v3 +
MIT License
266 stars 60 forks source link

How to read past version of keys #152

Open namnhcntt opened 2 years ago

namnhcntt commented 2 years ago

Is your feature request related to a problem? Please describe. I cannot find any doc about read past version of keys.

Describe the solution you'd like In etcdctl:

etcdctl get --prefix --rev=4 foo # access the versions of keys at revision 4

So how can do the same with dotnet-etcd?

Additional context I'm using latest version of dotnet etcd for now (5.2.1), .NET Core 6. Thanks

setood commented 2 years ago
var kv = client.Get(
  new RangeRequest
  {
    Key = ByteString.CopyFromUtf8("foo"),
    RangeEnd = ByteString.CopyFromUtf8(dotnet_etcd.EtcdClient.GetRangeEnd("foo")),
    Revision = 4
  });
shubhamranjan commented 2 years ago

Yep, docs are not updated yet. I am currently working on revamping the lib from scratch to figure out the connection reliability issues. especially the ones related to watch. I try my best to keep things updated from whatever time I get.

Until then, as @setood figured it out. You can figure it by using your IDE's intellisense by looking at what params are available. I have exposed every param for every method given by etcd's grpc api.