mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-22 07:15:25 +00:00
add crypto news
This commit is contained in:
@@ -5,11 +5,38 @@ package crypto;
|
||||
option go_package = "./proto;crypto";
|
||||
|
||||
service Crypto {
|
||||
rpc News(NewsRequest) returns (NewsResponse) {}
|
||||
rpc Quote(QuoteRequest) returns (QuoteResponse) {}
|
||||
rpc Price(PriceRequest) returns (PriceResponse) {}
|
||||
rpc History(HistoryRequest) returns (HistoryResponse) {}
|
||||
}
|
||||
|
||||
message Article {
|
||||
// title of the article
|
||||
string title = 1;
|
||||
// its description
|
||||
string description = 2;
|
||||
// the source url
|
||||
string url = 3;
|
||||
// the date published
|
||||
string date = 4;
|
||||
// the source
|
||||
string source = 5;
|
||||
}
|
||||
|
||||
// Get news related to a currency
|
||||
message NewsRequest {
|
||||
// cryptocurrency ticker to request news for e.g BTC
|
||||
string symbol = 1;
|
||||
}
|
||||
|
||||
message NewsResponse {
|
||||
// symbol requested for
|
||||
string symbol = 1;
|
||||
// list of articles
|
||||
repeated Article articles = 2;
|
||||
}
|
||||
|
||||
// Get the last price for a given crypto ticker
|
||||
message PriceRequest {
|
||||
// crypto symbol e.g BTCUSD
|
||||
|
||||
Reference in New Issue
Block a user