Commit | Line | Data |
---|---|---|
b153c0fd | 1 | import { ListenOptions } from 'net'; |
8114d10e | 2 | |
9efbac5b | 3 | import type { WorkerChoiceStrategy } from 'poolifier'; |
8114d10e JB |
4 | import { ServerOptions as WSServerOptions } from 'ws'; |
5 | ||
6 | import { StorageType } from './Storage'; | |
a4624c96 JB |
7 | import { WorkerProcessType } from './Worker'; |
8 | ||
b153c0fd | 9 | export type ServerOptions = WSServerOptions & ListenOptions; |
66271092 | 10 | |
2dcfe98e JB |
11 | export enum SupervisionUrlDistribution { |
12 | ROUND_ROBIN = 'round-robin', | |
13 | RANDOM = 'random', | |
14 | SEQUENTIAL = 'sequential', | |
15 | } | |
16 | ||
1f5df42a | 17 | export interface StationTemplateUrl { |
e118beaa JB |
18 | file: string; |
19 | numberOfStations: number; | |
20 | } | |
21 | ||
675fa8e3 | 22 | export interface UIServerConfiguration { |
6a49ad23 | 23 | enabled?: boolean; |
66271092 | 24 | options?: ServerOptions; |
6a49ad23 JB |
25 | } |
26 | ||
72f041bd JB |
27 | export interface StorageConfiguration { |
28 | enabled?: boolean; | |
29 | type?: StorageType; | |
1f5df42a | 30 | uri?: string; |
72f041bd JB |
31 | } |
32 | ||
cf2a5d9b JB |
33 | export interface WorkerConfiguration { |
34 | processType?: WorkerProcessType; | |
35 | startDelay?: number; | |
36 | elementsPerWorker?: number; | |
37 | elementStartDelay?: number; | |
38 | poolMinSize?: number; | |
39 | poolMaxSize?: number; | |
40 | poolStrategy?: WorkerChoiceStrategy; | |
41 | } | |
42 | ||
e118beaa | 43 | export default interface ConfigurationData { |
2dcfe98e JB |
44 | supervisionUrls?: string | string[]; |
45 | supervisionUrlDistribution?: SupervisionUrlDistribution; | |
1f5df42a | 46 | stationTemplateUrls: StationTemplateUrl[]; |
675fa8e3 | 47 | uiServer?: UIServerConfiguration; |
72f041bd | 48 | performanceStorage?: StorageConfiguration; |
cf2a5d9b | 49 | worker?: WorkerConfiguration; |
e118beaa | 50 | autoReconnectMaxRetries?: number; |
cf2a5d9b | 51 | // deprecated |
a4624c96 | 52 | workerProcess?: WorkerProcessType; |
cf2a5d9b | 53 | // deprecated |
322c9192 | 54 | workerStartDelay?: number; |
cf2a5d9b | 55 | // deprecated |
4bfd80fa | 56 | elementStartDelay?: number; |
cf2a5d9b | 57 | // deprecated |
a4624c96 | 58 | workerPoolMinSize?: number; |
cf2a5d9b | 59 | // deprecated |
4fa59b8a | 60 | workerPoolMaxSize?: number; |
cf2a5d9b | 61 | // deprecated |
9efbac5b | 62 | workerPoolStrategy?: WorkerChoiceStrategy; |
cf2a5d9b | 63 | // deprecated |
5fdab605 | 64 | chargingStationsPerWorker?: number; |
72f041bd | 65 | logStatisticsInterval?: number; |
e118beaa | 66 | logFormat?: string; |
324fd4ee | 67 | logLevel?: string; |
6bf6769e JB |
68 | logRotate?: boolean; |
69 | logMaxFiles?: number; | |
e118beaa | 70 | logFile?: string; |
7ec46a9a JB |
71 | logErrorFile?: string; |
72 | logConsole?: boolean; | |
e118beaa | 73 | } |