-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.nim
60 lines (49 loc) · 1.09 KB
/
types.nim
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
import tables
type
ExprKind* = enum
SingleLine Bracket End
Construct* = enum
Service = "service"
Message = "message"
Enum = "enum"
OneOf = "oneof"
Rpc = "rpc"
Expr* = ref object
case kind*: ExprKind
of SingleLine:
line*: string
of Bracket:
`type`*: Construct
name*: string
lines*: seq[Expr]
of End:
nil
FieldProto* = object
name*: string
kind*: string
pos*: int
repeated*: bool
MessageProto* = object
name*: string
fields*: TableRef[string, FieldProto]
ArityService* = object
`type`*: string
stream*: bool
RpcProto* = object
name*: string
request*, response*: ArityService
ServiceProto* = object
name*: string
rpcs*: TableRef[string, RpcProto]
Proto* = object
syntax*: string
messages*: TableRef[string, MessageProto]
services*: TableRef[string, ServiceProto]
DbInfo* = object
sqltype*, name*, host*, user*, pass*, port*: string
GrpcServiceInfo* = object
name*: string
basepath*: string
gopath*: string
raven*: string
db*: DbInfo