Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/binocarlos/etcdx
node client for etcd v2 that adheres to waitIndex for watching
https://github.com/binocarlos/etcdx
Last synced: 10 days ago
JSON representation
node client for etcd v2 that adheres to waitIndex for watching
- Host: GitHub
- URL: https://github.com/binocarlos/etcdx
- Owner: binocarlos
- Created: 2013-12-22T20:17:55.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2013-12-22T23:03:53.000Z (almost 11 years ago)
- Last Synced: 2024-10-07T04:28:32.411Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 129 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# etcdx
![Build status](https://api.travis-ci.org/binocarlos/etcdx.png)
node client for etcd v2 that adheres to waitIndex for watching.
## example
```js
var etcdx = require('etcdx');
var client = new etcdx();client.watch('/mongo_servers', true, function(error, server){
// server is 'hello' then 'hello2'
})client.set('/mongo_servers/server1', 'hello');
client.set('/mongo_servers/server1', 'hello2');
```## install
```
$ npm install etcdx
```## methods
### configure(opts)
set the following options for further requests to the etcd server:
* protocol
* host
* port
* version## watch(key, recursive, trigger)
run 'trigger' each time a value at or below 'key' changes'recursive' controls how deep we are watching
this function looks at the global etcd waitIndex in case a value has changed in-between our watch requests
## get(key, done)
return the value of 'key'## set(key, value, done)
set the value of 'key'## set_ttl(key, value, ttl, done)
set the value of 'key' for 'ttl' seconds## del(key, done)
remove 'key'## ls(key, recursive, done)
list the entries below 'key' - recursive follows nested directories## mkdir(key, done)
create a directory (with no value) at 'key'## rmdir(key, done)
remove all values below key## licence
MIT