Skip to content

StupidHod/jetcd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jetcd

Build Status

Java client for etcd v3.

Getting started

Usage

EtcdClient client = EtcdClientBuilder.newBuilder().endpoints("http://localhost:2379").build();
EtcdKV kvClient = client.getKVClient();

ByteString key = ByteString.copyFrom("test_key", "UTF-8");
ByteString value = ByteString.copyFrom("test_value", "UTF-8");

// put the key-value
kvClient.put(key, value).get();
// get the value
ListenableFuture<RangeResponse> getFeature = kvClient.get(key);
RangeResponse response = getFeature.get();
assertEquals(response.getKvsCount(), 1);
assertEquals(response.getKvs(0).getValue().toStringUtf8(), "test_value");
// delete the key
kvClient.delete(key).get()

For full etcd v3 API, plesase refer to API_Reference.

Contact

License

jetcd is under the Apache 2.0 license. See the LICENSE file for details.

Releases

No releases published

Packages

No packages published

Languages

  • Java 79.8%
  • Protocol Buffer 18.9%
  • Shell 1.3%