-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.sproto
63 lines (55 loc) · 1.09 KB
/
test.sproto
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
.Some { # this is a type
name 0 : string # this is a string filed
id 1 : integer # this is a integer filed
bool 2 : boolean # this is a boolean filed
names 3 : *string #this is a string array
ids 4 : *integer #this is a integer array
bools 5 : *boolean #this is a boolean array
.NestedThing {
nest_name 0 : string
nest_id 1 : integer
}
n 6 : NestedThing
}
.Other {
.Some {
name 0 : string
}
name 0 : string
id 1 : integer
is_man 2 : boolean
s 3 : Some
}
foo 1 {
request {
s 0 : Some
}
response {
msg 0 : *string
}
}
bar 2 { # define a new protocol (for RPC used) with tag 1
request Other # Associate the type Person with foobar.request
response { # define the foobar.response type
ok 0 : boolean
}
}
.Person {
name 0 : string
addr 1 : string
sex 2 : integer
.PhoneNum {
type 0 : integer
number 1 : integer
}
numbers 3 : *PhoneNum
}
.A {
a 0 : integer
.B {
b 0 : integer
}
.C {
bb 0 : *B
}
}