mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
52 lines
1.1 KiB
Protocol Buffer
52 lines
1.1 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package twitter;
|
|
|
|
option go_package = "./proto;twitter";
|
|
|
|
service Twitter {
|
|
rpc Timeline(TimelineRequest) returns (TimelineResponse) {}
|
|
rpc Search(SearchRequest) returns (SearchResponse) {}
|
|
}
|
|
|
|
message Tweet {
|
|
// id of the tweet
|
|
int64 id = 1;
|
|
// text of the tweet
|
|
string text = 2;
|
|
// username of the person who tweeted
|
|
string username = 3;
|
|
// time of tweet
|
|
string created_at = 4;
|
|
// number of times retweeted
|
|
int64 retweeted_count = 7;
|
|
// number of times favourited
|
|
int64 favourited_count = 8;
|
|
}
|
|
|
|
// Get the timeline for a given user
|
|
message TimelineRequest {
|
|
// the username to request the timeline for
|
|
string username = 1;
|
|
// number of tweets to return. default: 20
|
|
int32 limit = 2;
|
|
}
|
|
|
|
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;
|
|
}
|