Skip to content

Instantly share code, notes, and snippets.

@arnaldojvg
Last active May 14, 2021 12:10
Show Gist options
  • Save arnaldojvg/dddd4f93c5ad4aec5b14ee47199e2aec to your computer and use it in GitHub Desktop.
Save arnaldojvg/dddd4f93c5ad4aec5b14ee47199e2aec to your computer and use it in GitHub Desktop.
Sample with repeated and optional rules
import "covid_updates.proto";
enum SortType {
ASCENDING = 1;
DESCENDING = 2;
}
message CovidUpdateRequest {
optional uint32 size = 1; // How many records
optional SortType sort = 2;
optional uint64 date = 3; // This request works only per date basis (for simplicity)
optional UpdateType type = 4; // Only requesting messages for an specific update type
}
message CovidUpdatesResponse {
optional uint32 amount = 1;
repeated CovidUpdate updates = 2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment