generate protobuf client/server
This commit is contained in:
1
.idea/go-iperf.iml
generated
1
.idea/go-iperf.iml
generated
@@ -6,5 +6,6 @@
|
|||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="Bundled Protobuf Distribution" level="application" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
19
.idea/workspace.xml
generated
19
.idea/workspace.xml
generated
@@ -2,20 +2,11 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="fc2840de-29dc-4fca-8e0e-a283562f60ca" name="Default Changelist" comment="">
|
<list default="true" id="fc2840de-29dc-4fca-8e0e-a283562f60ca" name="Default Changelist" comment="">
|
||||||
<change afterPath="$PROJECT_DIR$/api/Dockerfile" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/go-iperf.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/go-iperf.iml" afterDir="false" />
|
||||||
<change afterPath="$PROJECT_DIR$/api/build.sh" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/api/proto/control.proto" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/controller.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/api/Dockerfile" beforeDir="false" afterPath="$PROJECT_DIR$/api/Dockerfile" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/client.go" beforeDir="false" afterPath="$PROJECT_DIR$/client.go" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/api/build.sh" beforeDir="false" afterPath="$PROJECT_DIR$/api/build.sh" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/cmd/main.go" beforeDir="false" afterPath="$PROJECT_DIR$/cmd/main.go" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/api/proto/control.proto" beforeDir="false" afterPath="$PROJECT_DIR$/api/proto/control.proto" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/reporter.go" beforeDir="false" afterPath="$PROJECT_DIR$/reporter.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/reporter_linux.go" beforeDir="false" afterPath="$PROJECT_DIR$/reporter_linux.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/reporter_windows.go" beforeDir="false" afterPath="$PROJECT_DIR$/reporter_windows.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/server.go" beforeDir="false" afterPath="$PROJECT_DIR$/server.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/shared.go" beforeDir="false" afterPath="$PROJECT_DIR$/shared.go" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/tests/client/client.go" beforeDir="false" afterPath="$PROJECT_DIR$/tests/client/client.go" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@@ -30,7 +21,7 @@
|
|||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="GOROOT" url="file://$PROJECT_DIR$/../../../../../Program Files/Go" />
|
<component name="GOROOT" url="file:///usr/local/go" />
|
||||||
<component name="Git.Settings">
|
<component name="Git.Settings">
|
||||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ LABEL maintainer="Benjamin Grewell <bgrewell@gmail.com>"
|
|||||||
ENV PROTOC_VERSION 3.6.1
|
ENV PROTOC_VERSION 3.6.1
|
||||||
ENV PROTOC_GEN_GO_VERSION v1.2.0
|
ENV PROTOC_GEN_GO_VERSION v1.2.0
|
||||||
|
|
||||||
WORKDIR /go/src/github.com/BGrewell/go-iperf/api/proto
|
WORKDIR /go/src/github.com/BGrewell/go-iperf/api
|
||||||
|
|
||||||
RUN apt update
|
RUN apt update
|
||||||
RUN apt install -y protobuf-compiler python3 python3-pip
|
RUN apt install -y protobuf-compiler python3 python3-pip
|
||||||
@@ -15,7 +15,7 @@ RUN pip3 install grpcio-tools
|
|||||||
RUN export PATH=$PATH:$GOPATH/bin
|
RUN export PATH=$PATH:$GOPATH/bin
|
||||||
RUN echo $PATH
|
RUN echo $PATH
|
||||||
|
|
||||||
COPY proto/control.proto control.proto
|
COPY proto/control.proto proto/control.proto
|
||||||
|
|
||||||
RUN mkdir go
|
RUN mkdir go
|
||||||
RUN protoc -I /. --go_out=plugins=grpc:go control.proto
|
RUN protoc -I proto/. --go_out=plugins=grpc:go control.proto
|
||||||
|
|||||||
4
api/build.sh
Normal file → Executable file
4
api/build.sh
Normal file → Executable file
@@ -8,14 +8,14 @@ fi
|
|||||||
echo "[+] Building docker container"
|
echo "[+] Building docker container"
|
||||||
docker image build -t go-iperf-builder:1.0 .
|
docker image build -t go-iperf-builder:1.0 .
|
||||||
docker container run --detach --name builder go-iperf-builder:1.0
|
docker container run --detach --name builder go-iperf-builder:1.0
|
||||||
docker cp grpc:/go/src/github.com/BGrewell/go-iperf/api/go/api.pb.go go/.
|
docker cp builder:/go/src/github.com/BGrewell/go-iperf/api/go/github.com/BGrewell/go-iperf/api/control.pb.go go/.
|
||||||
echo "[+] Updating of go library complete"
|
echo "[+] Updating of go library complete"
|
||||||
|
|
||||||
echo "[+] Removing docker container"
|
echo "[+] Removing docker container"
|
||||||
docker rm builder
|
docker rm builder
|
||||||
|
|
||||||
echo "[+] Adding new files to source control"
|
echo "[+] Adding new files to source control"
|
||||||
git add go/api.pb.go
|
git add go/control.pb.go
|
||||||
git commit -m "regenerated grpc libraries"
|
git commit -m "regenerated grpc libraries"
|
||||||
git push
|
git push
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ syntax = "proto3";
|
|||||||
|
|
||||||
import "google/protobuf/empty.proto";
|
import "google/protobuf/empty.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/BGrewell/go-iperf/api";
|
||||||
|
|
||||||
// [START java_declaration]
|
// [START java_declaration]
|
||||||
option java_multiple_files = true;
|
option java_multiple_files = true;
|
||||||
option java_package = "com.bengrewell.go-iperf.control";
|
option java_package = "com.bengrewell.go-iperf.control";
|
||||||
|
|||||||
Reference in New Issue
Block a user