syntax = "proto3"; package weather; message City { // See: https://en.wikipedia.org/wiki/ISO_3166-2 string code = 1; string name = 2; } message Temperature { // See: https://en.wikipedia.org/wiki/ISO_3166-2 string code = 1; int32 current = 2; } message CityQuery { message Result { repeated City cities = 2; } } message GetTemperature { string code = 1; } message Ping { message Ack {} } message Forecast { string code = 1; string date = 2; message Result { Temperature temperature = 1; } } service Weather { rpc cities(CityQuery) returns (CityQuery.Result); rpc get(GetTemperature) returns (stream Temperature); // Unsupported at the moment rpc ping(stream Ping) returns (Ping.Ack); rpc forecast(stream Forecast) returns (stream Forecast.Result); }