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