// Load the etcd client module.import{etcd}from"sdk/etcd";// Initialize the etcd client.letetcdClient=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");
Functions
Function
Description
Returns
getClient()
Returns an object representing an Etcd Client
Client
Objects
Client
Function
Description
Returns
putStringValue(key, value)
Puts a key-value pair to the etcd storage where the value should be a string
-
putByteArrayValue(key, value)
Puts a key-value pair to the etcd storage where the value should be a byte array
-
getHeader(key)
Returns an object representing an Etcd Header
Header
getKvsStringValue(key)
Returns a key-value object with string value
js object
getKvsByteArrayValue(key)
Returns a key-value object with byte array value
js object
getCount(key)
Returns the number of keys if the get method is for range