| 1 |
syntax = "proto3"; |
| 2 |
|
| 3 |
package test; |
| 4 |
option go_package="../test"; |
| 5 |
|
| 6 |
import "google/protobuf/timestamp.proto"; |
| 7 |
|
| 8 |
message UserId { |
| 9 |
oneof user_id { |
| 10 |
string kafka_user_id = 1; |
| 11 |
int32 other_user_id = 2; |
| 12 |
MessageId another_id = 3; |
| 13 |
} |
| 14 |
} |
| 15 |
|
| 16 |
message MessageId { |
| 17 |
string id = 1; |
| 18 |
} |
| 19 |
|
| 20 |
enum Status { |
| 21 |
ACTIVE = 0; |
| 22 |
INACTIVE = 1; |
| 23 |
} |
| 24 |
|
| 25 |
message ComplexType { |
| 26 |
oneof some_val { |
| 27 |
string one_id = 1; |
| 28 |
int32 other_id = 2; |
| 29 |
} |
| 30 |
bool is_active = 3; |
| 31 |
} |
| 32 |
|
| 33 |
/* |
| 34 |
* Complex message using nested protos and repeated fields |
| 35 |
*/ |
| 36 |
message NestedMessage { |
| 37 |
UserId user_id = 1; |
| 38 |
bool is_active = 2; |
| 39 |
repeated string experiments_active = 3; |
| 40 |
google.protobuf.Timestamp updated_at = 4; |
| 41 |
Status status = 5; |
| 42 |
ComplexType complex_type = 6; |
| 43 |
map<string, string> map_type = 7; |
| 44 |
InnerMessage inner = 8; |
| 45 |
|
| 46 |
message InnerMessage { |
| 47 |
string id = 1 [json_name="id"]; |
| 48 |
repeated int32 ids = 2 [packed=true]; |
| 49 |
} |
| 50 |
|
| 51 |
enum InnerEnum { |
| 52 |
option allow_alias = true; |
| 53 |
ZERO = 0; |
| 54 |
ALSO_ZERO = 0; |
| 55 |
} |
| 56 |
|
| 57 |
reserved 14, 15, 9 to 11; |
| 58 |
reserved "foo", "bar"; |
| 59 |
} |