3 ms·
Well there is Timestamp defined as a well known type which is available to all implementations despite not being a primitive type [1]. Plus one is obviously abl
by Matthias247 5y ago
Well there is Timestamp defined as a well known type which is available to all implementations despite not being a primitive type [1]. Plus one is obviously able to define any other custom types if necessary- eg as seen in [2].
[1] https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp https://developers.google.com/protocol-buffers/docs/referenc...
[2] https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto https://github.com/googleapis/googleapis/blob/master/google/...
- sandermvanvliet 5y agoOk my bad, I was looking to quickly through the base types in the proto reference
- ithkuil 5y agoWell known types strike an interesting balance between IDL and compiler simplicity vs ergonomics. For example maps were added in proto3. They use the same binary encoding as the proto2 pattern that you could use to implement mappings (repeated field of key value pair messages). Adding maps as first class citizen in the IDL dealt with the lack of type parameters that would have been needed to implement a Map well-known type.