-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathhello.proto
65 lines (58 loc) · 1.36 KB
/
hello.proto
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
syntax = "proto3";
package demo;
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
// Service demo.
//
// All leading comments will be copied to markdown.
service Demo {
// Rpc demo
//
// All leading comments will be copied to markdown.
rpc Echo1(Foo) returns (google.protobuf.Empty) {}
// Another rpc demo
rpc Echo2(google.protobuf.Empty) returns (Foo) {}
}
// Leading comments of message will be ignored.
message Foo {
// boolean value demo
bool a = 1;
// 32 bit int value demo
int32 b = 2;
// 64 bit int value demo
int64 c = 3; // stored as string
// float value demo
double d = 4;
// string value demo
string e = 5;
// bytes value demo
bytes f = 6; // stored as base64 string
// message value demo
Bar g = 7;
// imported message value demo
google.protobuf.Timestamp h = 8;
}
message Bar {
// string list value demo
repeated string a = 1;
// map value demo
map<int32,string> b = 2;
// self reference value demo
Baz c = 3;
enum Sex {
Unknown = 0;
Male = 1;
Female = 2;
}
// enum value demo
Sex d = 4;
// message list value demo
repeated Person e = 5;
}
message Baz {
Bar a = 1; // self-referenced message will be displayed as {}
}
message Person {
string name = 1;
int32 age = 2;
}