Protocol buffers are a flexible and efficient way to represent structured data.
- Binary Serialzation
- Schema vs Schemaless
- Parse time
- Backwards compatibility
- Cross language/platform
double
float
int64
uint64
int32
uint32
bool
string
bytes
Duration
Timestamp
Empty
Any
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