Protocol buffers are a flexible and efficient way to represent structured data.
- Binary Serialzation
- Schema vs Schemaless
- Parse time
- Backwards compatibility
- Cross language/platform
doublefloatint64uint64int32uint32boolstringbytes
DurationTimestampEmptyAny
syntax = "proto2";syntax = "proto3";
syntax = "proto3";
package gobuildit;
import "google/protobuf/timestamp.proto";
message Request {
uint64 id = 1;
string name = 2;
google.protobuf.Timestamp timestamp = 3;
}protoc -I . -I include/ --go_out=out/ request.proto