Skip to content

dirigiblelabs/ext-etcd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

ext-etcd

API Module for Etcd.

Etcd is a key-value store written in Go which provides a reliable way to store data that needs to be accessed by a distributed system or cluster of machines.

Prerequisite

For this API to work etcd should be setup and running. You can either download the pre-built binary or build the latest version from the master branch of etcd. Please refer to the official instructions at provided at etcd docs.

Example

// Load the etcd client module.
var etcd = require("etcd/client");

// Initialize the etcd client.
var etcdClient = etcd.getClient();

// Put key value pair where the value is a string.
etcdClient.putStringValue("foo", "bar");

// Get key value pair where value will be returned as a string.
etcdClient.getKvsStringValue("foo"); // => { "foo": "bar" }

// Put key value pair where the value is a byte array.
etcdClient.putByteArrayValue("foo", [98, 97, 114]);

// Get key value pair where value will be returned as a byte array.
etcdClient.getKvsByteArrayValue("foo"); // => { "foo": [98, 97, 114] }

// Delete key value pair.
etcdClient.delete("foo");

About

API Module for Etcd

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •