-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
102 lines (74 loc) · 1.79 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/// <reference types="node" />
import {
Application,
Context,
Agent,
} from 'egg';
import { EggLogger, EggLoggers, LoggerLevel as EggLoggerLevel, EggLoggersOptions, EggLoggerOptions, EggContextLogger } from 'egg-logger';
export class PomeloManagerAgent {
/** Egg Application */
agent: Agent
logger: EggLogger
drv: Object
}
export type CmdRet = {
/** Job name */
status: Boolean
/** retData */
data : Object
};
export class PomeloManagerApp {
/** Egg Application */
app: Application
logger: EggLogger
/** 执行命令
* @param {string} cmd - command,example: show servers
* @param {string} context - run context, all or serverId
* @param {string} masterName which master
*/
runAction( cmd:String, context:String, masterName:String ): CmdRet
/** 执行管理命令
* @param {string} cmd - command,example: show servers
*/
runMgrCmd(cmd:String):CmdRet
/** 执行脚本字符串 */
execStr( script:String, context:String ): CmdRet
}
type MasterCfg = {
/** master server host */
host: String;
/** master server port */
port: Number;
/** master login username */
username: String;
/** master login password */
password: String;
}
/** pomelo 配置选项 */
type EggPomeloOption = {
/** master cfg */
master: MasterCfg,
/** redis server host */
host: String;
/** redis server port */
port: Number;
/** redis server password */
password: String;
/** redis server db index */
db: Number;
/** redis schex key pre */
keyPre: String;
/** schex check job status interval( ms ) */
checkInterval: Number;
}
interface EggPomeloOptions {
client: EggPomeloOption;
}
declare module 'egg' {
interface Application {
pomelo: PomeloManagerApp;
}
interface EggAppConfig {
pomelo: EggPomeloOptions;
}
}