autogenpb/example/toy.proto

35 lines
1.4 KiB
Protocol Buffer
Raw Permalink Normal View History

2025-01-12 09:28:58 -06:00
syntax = "proto3";
package main;
import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp
message Basket { // `autogenpb:nomutex`
repeated string name = 1; // `autogenpb:sort` `autogenpb:unique`
string favorite = 2; // `autogenpb:sort` `autogenpb:unique`
int64 price = 3; // `autogenpb:sort`
repeated Banana banna = 4;
repeated Pear pears = 5;
repeated Apple stacks = 6;
}
// "Fruit" must exist. you can put anything in it
message Toy {
string brand = 1; // `autogenpb:unique` `autogenpb:sort`
repeated Apple apples = 2;
string name = 4; // `autogenpb:sort` `autogenpb:unique`
string UPC = 4; // `autogenpb:sort` `autogenpb:unique`
string city = 5; // `autogenpb:sort`
repeated Basket Baskets = 8;
map<string, string> who = 9;
int64 cost = 10;
}
message Toys { // `autogenpb:marshal` `autogenpb:mutex`
string uuid = 1; // `autogenpb:uuid:be456ad9-f07f-484c-adf2-d96eeabf3079`
string version = 2; // `autogenpb:version:v0.0.1`
repeated Toy Toys = 3; // THIS MUST BE "Fruit" and then "Fruit" + "s"
// you can add additional things here but the three lines above must conform to the standard above
}