Add grpc-gateway for HTTP JSON API
This commit is contained in:
@@ -18,6 +18,14 @@ for %%A in (%*) do (
|
||||
echo Generating Go code
|
||||
!exec! --go_out=plugins=grpc:!out! %pbs%
|
||||
)
|
||||
if "%%A"=="gohttp" (
|
||||
set plugin=protoc-gen-grpc-gateway
|
||||
where /q !plugin! || echo Missing !plugin! && exit /b
|
||||
set out=%gen%\go
|
||||
if not exist !out! mkdir !out!
|
||||
echo Generating Go HTTP code
|
||||
!exec! --grpc-gateway_out=grpc_api_configuration=bdware/bdledger/api/grpc-gateway.yml,logtostderr=true:!out! %pbs%
|
||||
)
|
||||
if "%%A"=="nodejs" (
|
||||
set plugin=grpc_tools_node_protoc_plugin
|
||||
where /q !plugin! || echo missing !plugin! && exit /b
|
||||
|
||||
@@ -43,6 +43,19 @@ do
|
||||
echo "Generating Go code"
|
||||
$exec --go_out=plugins=grpc:$out $pb_files $async_tag
|
||||
fi
|
||||
if [ $aug == "gohttp" ]; then
|
||||
plugin=protoc-gen-grpc-gateway
|
||||
which $plugin > /dev/null
|
||||
if [ $? -ne 0 ];then
|
||||
echo "missing plugin: $plugin" && exit
|
||||
fi
|
||||
out="$gen_dir/go"
|
||||
if [ ! -d $out ]; then
|
||||
mkdir -p $out
|
||||
fi
|
||||
echo "Generating Go HTTP code"
|
||||
$exec --grpc-gateway_out=grpc_api_configuration=bdware/bdledger/api/grpc-gateway.yml,logtostderr=true:$out $pb_files $async_tag
|
||||
fi
|
||||
if [ $aug == "nodejs" ]; then
|
||||
plugin=grpc_tools_node_protoc_plugin
|
||||
plugin_path=$(which $plugin)
|
||||
|
||||
Reference in New Issue
Block a user