This commit is contained in:
Zheng Kai
2023-03-30 10:07:57 +08:00
parent 1b107ed035
commit 049277f1f6
19 changed files with 889 additions and 20 deletions

11
proto/Makefile Normal file
View File

@@ -0,0 +1,11 @@
SHELL:=/bin/bash
server:
protoc --go_out=../server/src *.proto
client:
../client/node_modules/protobufjs/bin/pbjs -t static-module -w es6 --es6 --force-number -o ../client/src/pb/pb.js *.proto
../client/node_modules/protobufjs/bin/pbts -o ../client/src/pb/pb.d.ts ../client/src/pb/pb.js
sed 's#^import.*$$#const $$protobuf = require("protobufjs/minimal");#g' -i ../client/src/pb/pb.js
all: server client

9
proto/req.proto Normal file
View File

@@ -0,0 +1,9 @@
syntax = "proto3";
option go_package = "/pb";
package pb;
message Req {
string method = 1;
string path = 2;
bytes body = 3;
}