(no title)
andrewg | 5 years ago
message Config {
repeated Server server = 1;
}
message Server {
string address = 1;
int32 port = 2;
bool standby = 3;
}
And then you use the text representation in a config file: # main instance
server { address: "127.0.0.1" port: 4567 }
# backup instance
server { address: "127.0.0.1" port: 9876 standby: true }
And load it into a message instance: Config config;
google::protobuf::TextFormat::ParseFromString(input, &config);
atombender|5 years ago
kortex|5 years ago
It looks oddly like HCL. I wonder...