add search to twitter

This commit is contained in:
Asim Aslam
2021-09-15 14:20:09 +01:00
parent 7bbd58d0be
commit 3181190e40
5 changed files with 228 additions and 19 deletions

View File

@@ -6,6 +6,7 @@ option go_package = "./proto;twitter";
service Twitter {
rpc Timeline(TimelineRequest) returns (TimelineResponse) {}
rpc Search(SearchRequest) returns (SearchResponse) {}
}
message Tweet {
@@ -35,3 +36,16 @@ message TimelineResponse {
// The recent tweets for the user
repeated Tweet tweets = 1;
}
// Search for tweets with a simple query
message SearchRequest {
// the query to search for
string query = 1;
// number of tweets to return. default: 20
int32 limit = 2;
}
message SearchResponse {
// the related tweets for the search
repeated Tweet tweets = 2;
}