es-etcd
A simple etcd node client with tls support.
npm i --save es-etcd
Example Usage
{ const esEtcd = scheme: 'https' host: '0.0.0.0' port: 2379 agentOpts: ca: fs key: fs cert: fs console}
Constructor
fields | description |
---|---|
scheme | 'http' or 'https' if using https remember to set agentOpts |
host | Address of etcd server |
port | Port of etcd server |
agentOpts | { ca, key, cert } use fs.readFileSync for these fields |
const esEtcd = scheme: 'https' host: '0.0.0.0' port: 2379 agentOpts: ca: fs key: fs cert: fs
API
get
- key
- opts -
{ recursive: true }
await esEtcd
set
- key
- value
rm
- key
- opts -
{ recursive: true }
watch
- key
- cb
mkdir
- key