pmcf 2.33.0 → 2.33.2
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/package.json
CHANGED
package/src/cluster.mjs
CHANGED
|
@@ -147,7 +147,7 @@ export class Cluster extends Host {
|
|
|
147
147
|
cfg.push(` protocol ${service.protocol.toUpperCase()}`);
|
|
148
148
|
|
|
149
149
|
for (const member of this.members) {
|
|
150
|
-
const memberService = member.findService({ type: service.type });
|
|
150
|
+
const memberService = member.findService({ type: service.type }) || member.host.findService({ type: service.type }); // TODO
|
|
151
151
|
|
|
152
152
|
cfg.push(` real_server ${member.address} ${memberService.port} {`);
|
|
153
153
|
cfg.push(` weight ${memberService.weight}`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { writeLines, sectionLines } from "../utils.mjs";
|
|
3
|
-
import { NetworkAddress } from "pmcf";
|
|
3
|
+
import { NetworkAddress, Host } from "pmcf";
|
|
4
4
|
import { ServiceOwner } from "../service-owner.mjs";
|
|
5
5
|
import { cidrAddresses } from "../network-support.mjs";
|
|
6
6
|
|
|
@@ -29,7 +29,9 @@ export class SkeletonNetworkInterface extends ServiceOwner {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
get host() {
|
|
32
|
-
|
|
32
|
+
if(this.owner instanceof Host) {
|
|
33
|
+
return this.owner;
|
|
34
|
+
}
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
*hosts() {
|
package/src/service.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isLocalhost } from "ip-utilties";
|
|
2
|
-
import { Base, Endpoint } from "pmcf";
|
|
2
|
+
import { Base, Host, Endpoint } from "pmcf";
|
|
3
3
|
import { addType } from "./types.mjs";
|
|
4
4
|
import { asArray } from "./utils.mjs";
|
|
5
5
|
import { networkAddressProperties } from "./network-support.mjs";
|
|
@@ -149,7 +149,9 @@ export class Service extends Base {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
get host() {
|
|
152
|
-
|
|
152
|
+
if(this.owner instanceof Host) {
|
|
153
|
+
return this.owner;
|
|
154
|
+
}
|
|
153
155
|
}
|
|
154
156
|
|
|
155
157
|
*hosts() {
|
|
@@ -331,7 +331,6 @@ export class NetworkInterface extends SkeletonNetworkInterface {
|
|
|
331
331
|
get gatewayAddress(): any;
|
|
332
332
|
set hostName(value: any);
|
|
333
333
|
get hostName(): any;
|
|
334
|
-
get domainNames(): any;
|
|
335
334
|
set scope(value: any);
|
|
336
335
|
get scope(): any;
|
|
337
336
|
set hwaddr(value: any);
|
|
@@ -4,6 +4,7 @@ export class SkeletonNetworkInterface extends ServiceOwner {
|
|
|
4
4
|
get typeName(): string;
|
|
5
5
|
set extends(value: any[]);
|
|
6
6
|
get extends(): any[];
|
|
7
|
+
get host(): Host;
|
|
7
8
|
hosts(): Generator<any, void, any>;
|
|
8
9
|
get network_interface(): this;
|
|
9
10
|
get domainNames(): Set<any>;
|
|
@@ -24,4 +25,5 @@ export class SkeletonNetworkInterface extends ServiceOwner {
|
|
|
24
25
|
systemdDefinitions(packageData: any): Promise<void>;
|
|
25
26
|
}
|
|
26
27
|
import { ServiceOwner } from "../service-owner.mjs";
|
|
28
|
+
import { Host } from "pmcf";
|
|
27
29
|
import { NetworkAddress } from "pmcf";
|
package/types/service.d.mts
CHANGED
|
@@ -305,13 +305,14 @@ export class Service extends Base {
|
|
|
305
305
|
_extends: any[];
|
|
306
306
|
set extends(value: any[]);
|
|
307
307
|
get extends(): any[];
|
|
308
|
+
get host(): Host;
|
|
308
309
|
hosts(): Generator<any, void, any>;
|
|
309
310
|
get domainName(): any;
|
|
310
311
|
get ipAddressOrDomainName(): any;
|
|
311
312
|
get addresses(): any;
|
|
312
313
|
get address(): any;
|
|
313
314
|
set ipAddresses(value: any);
|
|
314
|
-
get networks(): any
|
|
315
|
+
get networks(): Set<any>;
|
|
315
316
|
endpoints(filter: any): any[];
|
|
316
317
|
set alias(value: any);
|
|
317
318
|
get alias(): any;
|
|
@@ -333,3 +334,4 @@ export class Service extends Base {
|
|
|
333
334
|
}
|
|
334
335
|
export function sortByPriority(a: any, b: any): number;
|
|
335
336
|
import { Base } from "pmcf";
|
|
337
|
+
import { Host } from "pmcf";
|