Switch to genproto.sh
This commit is contained in:
parent
ab5fb7bde4
commit
057d8ae35a
4 changed files with 2 additions and 60 deletions
|
@ -19,7 +19,7 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const grpc = require('grpc');
|
const grpc = require('grpc');
|
||||||
|
|
||||||
const PROTO_PATH = path.join(__dirname, './proto/currency_service.proto');
|
const PROTO_PATH = path.join(__dirname, './proto/demo.proto');
|
||||||
const PORT = 31337;
|
const PORT = 31337;
|
||||||
|
|
||||||
const shopProto = grpc.load(PROTO_PATH).hipstershop;
|
const shopProto = grpc.load(PROTO_PATH).hipstershop;
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
syntax = "proto3";
|
|
||||||
package hipstershop;
|
|
||||||
|
|
||||||
message Empty {}
|
|
||||||
|
|
||||||
service CurrencyService {
|
|
||||||
rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {}
|
|
||||||
rpc Convert(CurrencyConversionRequest) returns (Money) {}
|
|
||||||
}
|
|
||||||
// Describes a money amount without currency. For example, decimal=2 and
|
|
||||||
// fractional=500 (or fractional=5) makes up 2.5 units.
|
|
||||||
message MoneyAmount {
|
|
||||||
uint32 decimal = 1;
|
|
||||||
uint32 fractional = 2;
|
|
||||||
}
|
|
||||||
message Money {
|
|
||||||
// The 3-letter currency code defined in ISO 4217.
|
|
||||||
string currency_code = 1;
|
|
||||||
MoneyAmount amount = 2;
|
|
||||||
}
|
|
||||||
message GetSupportedCurrenciesResponse {
|
|
||||||
// The 3-letter currency code defined in ISO 4217.
|
|
||||||
repeated string currency_codes = 1;
|
|
||||||
}
|
|
||||||
message CurrencyConversionRequest {
|
|
||||||
Money from = 1;
|
|
||||||
// The 3-letter currency code defined in ISO 4217.
|
|
||||||
string to_code = 2;
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
syntax = "proto3";
|
|
||||||
package hipstershop;
|
|
||||||
|
|
||||||
message Empty {}
|
|
||||||
|
|
||||||
service CurrencyService {
|
|
||||||
rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {}
|
|
||||||
rpc Convert(CurrencyConversionRequest) returns (Money) {}
|
|
||||||
}
|
|
||||||
// Describes a money amount without currency. For example, decimal=2 and
|
|
||||||
// fractional=500 (or fractional=5) makes up 2.5 units.
|
|
||||||
message MoneyAmount {
|
|
||||||
uint32 decimal = 1;
|
|
||||||
uint32 fractional = 2;
|
|
||||||
}
|
|
||||||
message Money {
|
|
||||||
// The 3-letter currency code defined in ISO 4217.
|
|
||||||
string currency_code = 1;
|
|
||||||
MoneyAmount amount = 2;
|
|
||||||
}
|
|
||||||
message GetSupportedCurrenciesResponse {
|
|
||||||
// The 3-letter currency code defined in ISO 4217.
|
|
||||||
repeated string currency_codes = 1;
|
|
||||||
}
|
|
||||||
message CurrencyConversionRequest {
|
|
||||||
Money from = 1;
|
|
||||||
// The 3-letter currency code defined in ISO 4217.
|
|
||||||
string to_code = 2;
|
|
||||||
}
|
|
|
@ -19,7 +19,7 @@ const grpc = require('grpc');
|
||||||
const request = require('request');
|
const request = require('request');
|
||||||
const xml2js = require('xml2js');
|
const xml2js = require('xml2js');
|
||||||
|
|
||||||
const PROTO_PATH = path.join(__dirname, './proto/currency_service.proto');
|
const PROTO_PATH = path.join(__dirname, './proto/demo.proto');
|
||||||
const PORT = 31337;
|
const PORT = 31337;
|
||||||
const DATA_URL = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml';
|
const DATA_URL = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml';
|
||||||
const shopProto = grpc.load(PROTO_PATH).hipstershop;
|
const shopProto = grpc.load(PROTO_PATH).hipstershop;
|
||||||
|
|
Loading…
Reference in a new issue