Expose Slave to instance plugins

Allow the slave object to be accessed by instance plugins through the
this.slave property.
This commit is contained in:
Hornwitser committed 2020-04-03 20:51:28 +02:00
1 parent 3ff5e630ca
commit 9a4a535add
2 files changed
+26 -4

No files matched your search

+23 -1
View File
@@ -1,3 +1,7 @@
/**
* Plugin interfaces and utilities.
* @module
*/
"use strict";
const fs = require("fs-extra");
const path = require("path");
@@ -9,9 +13,27 @@ const errors = require("lib/errors");
* Base class for instance plugins
*/
class BaseInstancePlugin {
constructor(info, instance) {
constructor(info, instance, slave) {
/**
* The plugin's own info module
*/
this.info = info;
/**
* Instance the plugin started for
* @type {Instance}
*/
this.instance = instance;
/**
* Slave running the instance
*
* With the exepction of accessing the slave's config you should
* avoid ineracting with the slave object directly.
*
* @type {Slave}
*/
this.slave = slave;
}
/**