diff options
Diffstat (limited to 'example')
| -rw-r--r-- | example/fruit.proto | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/example/fruit.proto b/example/fruit.proto index 65e36f1..b119652 100644 --- a/example/fruit.proto +++ b/example/fruit.proto @@ -21,11 +21,23 @@ message Apple { google.protobuf.Timestamp ctime = 3; // when the apple was born } +message Apples { + string name = 1; // `autogenpb:unique` // generates SortByxxx() and AppendUnique() functions + string genus = 2; // `autogenpb:unique` // generates same thing here but SortByGenus() + repeated Apple apples = 3; +} + message Pear { // `autogenpb:nomutex` string name = 1; // `autogenpb:sort` string favorite = 2; // `autogenpb:sort` `autogenpb:unique` } +message Pears { // `autogenpb:nomutex` + string name = 1; // `autogenpb:sort` + string favorite = 2; // `autogenpb:sort` `autogenpb:unique` + repeated Pear pears = 3; +} + message Banana { // `autogenpb:nomutex` repeated string name = 1; // `autogenpb:sort` string favorite = 2; // `autogenpb:sort` `autogenpb:unique` @@ -43,14 +55,14 @@ message Basket { // `autogenpb:nomutex` // "Fruit" must exist. you can put anything in it message Fruit { - string brand = 1; // `autogenpb:unique` `autogenpb:sort` - repeated Apple apples = 2; - repeated Pear pears = 3; - string UPC = 4; // `autogenpb:sort` `autogenpb:unique` - string city = 5; // `autogenpb:sort` - repeated Pear notpears = 6; - repeated Pear fakepears = 7; - repeated Basket gifts = 8; + string brand = 1; // `autogenpb:unique` `autogenpb:sort` + Apple apples = 2; + repeated Pear pears = 3; + string UPC = 4; // `autogenpb:sort` `autogenpb:unique` + string city = 5; // `autogenpb:sort` + Pears notpears = 6; + Pears fakepears = 7; + repeated Basket gifts = 8; } // "Fruits" MUST EXIST and start exactly this way |
