-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtypes.ts
88 lines (80 loc) · 1.5 KB
/
types.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
/**
* Created by Wu Jian Ping on - 2021/06/09.
*/
import { AsyncResource } from 'async_hooks'
interface ConnectionOption {
host: string;
port: number;
userName: string;
password: string;
database: string;
}
interface Endpoint {
host: string;
port: number
}
interface ClientOption {
// nebula服务器列表
servers: string[] | Endpoint[];
// 用户名
userName: string;
// 密码
password: string;
// 数据库名称
database: string;
// 连接池大小,默认:5
poolSize?: number;
// 缓存区大小,默认:2000
bufferSize?: number;
// 查询超时(毫秒),包含在队列中等待时间和真正执行时间, 默认:10000
executeTimeout?: number;
// ping轮询时间(毫秒), 默认:30000
pingInterval?: number;
}
interface ConnectionInfo {
connectionId: string;
host: string;
port: number;
database: string;
isReady: boolean;
}
interface NebulaValue {
nVal: any;
bVal: any;
iVal: any;
fVal: any;
sVal: any;
dVal: any;
tVal: any;
dtVal: any;
vVal: any;
eVal: any;
pVal: any;
lVal: {
values: any[];
};
mVal: any;
uVal: any;
gVal: any;
}
interface Metrics {
execute: number;
traverse: number;
}
interface Task {
command: string;
returnOriginalData: boolean;
resolve: (value: any) => void;
reject: (err: any) => void;
asyncResource?: AsyncResource;
executingTimer?: NodeJS.Timeout;
}
export {
Endpoint,
ClientOption,
ConnectionOption,
NebulaValue,
Metrics,
Task,
ConnectionInfo
}