This repository has been archived by the owner on May 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
/
docs.jsig
110 lines (92 loc) · 2.15 KB
/
docs.jsig
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
103
104
105
106
107
108
109
110
type Logger : {
debug: (String, Object) => void,
info: (String, Object) => void,
warn: (String, Object) => void,
error: (String, Object) => void,
fatal: (String, Object) => void
}
type Timers : {
setTimeout: (Function, timeout: Number) => id: Number,
clearTimeout: (id: Number) => void,
now: () => timestamp: Number
}
type IP : String
type HostInfo : String
type TChannelValue :
Buffer | String | null | undefined
type TChannelInResponse : {
id: Number,
ok: Boolean,
arg1: Buffer,
arg2: Buffer,
arg3: Buffer
}
type TChannelOutRequest : {
id: Number,
serviceName: String,
send: (
arg1: Buffer | String,
arg2: TChannelValue,
arg3: TChannelValue,
cb: Callback<Error, res: TChannelInResponse>
) => void
}
type TChannelInRequest : {
id: Number,
serviceName: String,
arg1: Buffer,
arg2: Buffer,
arg3: Buffer
}
type TChannelOutResponse : {
id: Number,
code: Number,
ok: Boolean,
arg1: Buffer,
arg2: Buffer,
arg3: Buffer,
sendOk: (res1: Buffer, res2: Buffer) => void,
sendNotOk: (res1: Buffer, res2: Buffer) => void
}
type TChannelHandler : {
handleRequest : (
req: TChannelInRequest,
res: TChannelOutResponse
) => void
}
type TChannel : {
handler: TChannelHandler
request: (
options: {
host: HostInfo,
timeout?: Number
}
) => TChannelOutRequest,
listen: (
port:Number,
hostname:String,
Callback<Error>?
) => void,
address: () => ?{port, family, address}
close: (Callback<Error>) => void,
hostPort: HostInfo
}
tchannel : (options: {
handler?: TChannelHandler,
logger?: Logger,
timers?: Timers,
reqTimeoutDefault?: Number,
serverTimeoutDefault?: Number,
timeoutCheckInterval?: Number,
timeoutFuzz?: Number
}) => TChannel
tchannel/endpoint-handler : (serviceName: String) =>
TChannelHandler & {
register: (
name: String,
handler: (
req: TChannelInRequest,
res: TChannelOutResponse
) => void
)
}