gRPC
Example
proto
syntax = "proto3";
option go_package="./;rpc";
service market {
rpc AnalysisCsv (stream CsvFile) returns (CsvData) {}
}
message CsvFile {
bytes csv = 1;
string filename =2;
uint64 size = 3;
}
message CsvData {
Status status = 1;
map<string, ClassList> data = 2;
}
message ClassList {
repeated string list = 1;
}
message Status {
uint32 code =1;
string message = 2;
}
go
go get -u google.golang.org/grpc
go get -u github.com/golang/protobuf/protoc-gen-go
protoc -I ./ --go_out=plugins=grpc:./ rpc.proto
python
pip install grpcio grpcio-tools
python -m grpc_tools.protoc -I ./ --python_out=./ --grpc_python_out=./ rpc.proto
Validator