Proto3 Syntax
syntax = "proto3"; | File header |
message MyMsg { string name = 1; } | Message definition |
repeated string items = 1; | Repeated field (list) |
optional int32 count = 2; | Optional field |
oneof payload { string s = 1; int32 n = 2; } | Oneof |
enum Status { UNKNOWN=0; OK=1; ERROR=2; } | Enum |
map | Map field |
Well-Known Types
google.protobuf.Timestamp | Nanosecond timestamp |
google.protobuf.Duration | Duration |
google.protobuf.Any | Any message type |
google.protobuf.Struct | JSON-like structure |