initial commit
This commit is contained in:
20
third_party/libhv/examples/protorpc/proto/base.proto
vendored
Executable file
20
third_party/libhv/examples/protorpc/proto/base.proto
vendored
Executable file
@@ -0,0 +1,20 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package protorpc;
|
||||
|
||||
message Error {
|
||||
int32 code = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
message Request {
|
||||
uint64 id = 1;
|
||||
string method = 2;
|
||||
repeated bytes params = 3;
|
||||
}
|
||||
|
||||
message Response {
|
||||
uint64 id = 1;
|
||||
bytes result = 2;
|
||||
Error error = 3;
|
||||
}
|
||||
11
third_party/libhv/examples/protorpc/proto/calc.proto
vendored
Executable file
11
third_party/libhv/examples/protorpc/proto/calc.proto
vendored
Executable file
@@ -0,0 +1,11 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package protorpc;
|
||||
|
||||
message CalcParam {
|
||||
int64 num = 1;
|
||||
}
|
||||
|
||||
message CalcResult {
|
||||
int64 num = 1;
|
||||
}
|
||||
13
third_party/libhv/examples/protorpc/proto/login.proto
vendored
Executable file
13
third_party/libhv/examples/protorpc/proto/login.proto
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package protorpc;
|
||||
|
||||
message LoginParam {
|
||||
string username = 1;
|
||||
string password = 2;
|
||||
}
|
||||
|
||||
message LoginResult {
|
||||
uint64 user_id = 1;
|
||||
string token = 2;
|
||||
}
|
||||
18
third_party/libhv/examples/protorpc/proto/protoc.sh
vendored
Executable file
18
third_party/libhv/examples/protorpc/proto/protoc.sh
vendored
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd `dirname $0`
|
||||
|
||||
PROTOC=`which protoc`
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Not found command protoc!"
|
||||
echo "Please install libprotobuf first!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CPP_OUT_DIR=../generated
|
||||
if [ ! -d "${CPP_OUT_DIR}" ]; then
|
||||
mkdir -p ${CPP_OUT_DIR}
|
||||
fi
|
||||
|
||||
set -x
|
||||
${PROTOC} --cpp_out=${CPP_OUT_DIR} *.proto
|
||||
Reference in New Issue
Block a user