antietcd 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/antietcd.js +6 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -468,7 +468,9 @@ type MaintenanceStatusResponse = {
|
|
|
468
468
|
raft_term?: number,
|
|
469
469
|
},
|
|
470
470
|
version: string,
|
|
471
|
+
cluster?: { [string]: string },
|
|
471
472
|
leader?: string,
|
|
473
|
+
followers?: string[],
|
|
472
474
|
raftTerm?: string,
|
|
473
475
|
raftState?: 'leader'|'follower'|'candidate',
|
|
474
476
|
// dbSize actually reports process memory usage
|
package/antietcd.js
CHANGED
|
@@ -17,6 +17,8 @@ const AntiPersistence = require('./antipersistence.js');
|
|
|
17
17
|
const AntiCluster = require('./anticluster.js');
|
|
18
18
|
const { runCallbacks, RequestError } = require('./common.js');
|
|
19
19
|
|
|
20
|
+
const VERSION = '1.0.9';
|
|
21
|
+
|
|
20
22
|
class AntiEtcd extends EventEmitter
|
|
21
23
|
{
|
|
22
24
|
constructor(cfg)
|
|
@@ -72,7 +74,7 @@ class AntiEtcd extends EventEmitter
|
|
|
72
74
|
{
|
|
73
75
|
this.server = http.createServer((req, res) => this._handleRequest(req, res));
|
|
74
76
|
}
|
|
75
|
-
this.wss = new ws.
|
|
77
|
+
this.wss = new ws.Server({ server: this.server });
|
|
76
78
|
// eslint-disable-next-line no-unused-vars
|
|
77
79
|
this.wss.on('connection', (conn, req) => this._startWebsocket(conn, null));
|
|
78
80
|
this.server.listen(this.cfg.port || 2379, this.cfg.ip || undefined);
|
|
@@ -487,7 +489,9 @@ class AntiEtcd extends EventEmitter
|
|
|
487
489
|
raft_term: raft && raft.term || undefined,
|
|
488
490
|
},
|
|
489
491
|
version: 'antietcd '+AntiEtcd.VERSION,
|
|
492
|
+
cluster: this.cfg.cluster || undefined,
|
|
490
493
|
leader: raft && raft.leader || undefined,
|
|
494
|
+
followers: raft && raft.followers || undefined,
|
|
491
495
|
raftTerm: raft && raft.term || undefined,
|
|
492
496
|
raftState: raft && raft.state || undefined,
|
|
493
497
|
dbSize: process.memoryUsage().heapUsed,
|
|
@@ -567,6 +571,6 @@ class AntiEtcd extends EventEmitter
|
|
|
567
571
|
|
|
568
572
|
AntiEtcd.RequestError = RequestError;
|
|
569
573
|
|
|
570
|
-
AntiEtcd.VERSION =
|
|
574
|
+
AntiEtcd.VERSION = VERSION;
|
|
571
575
|
|
|
572
576
|
module.exports = AntiEtcd;
|