vendor proto files from google (#1536)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-04-15 13:22:32 +03:00 committed by GitHub
parent b700d425a4
commit 4d177a782e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

10
.github/generate.sh vendored
View File

@ -1,9 +1,15 @@
#!/bin/bash -e #!/bin/bash -e
find . -type f -name '*.pb.*.go' -o -name '*.pb.go' -a ! -name 'message.pb.go' -delete find . -type f -name '*.pb.*.go' -o -name '*.pb.go' -a ! -name 'message.pb.go' -delete
PROTOS=$(find . -type f -name '*.proto') PROTOS=$(find . -type f -name '*.proto' | grep -v proto/google/api)
mkdir -p proto/google/api
curl -s -o proto/google/api/annotations.proto -L https://raw.githubusercontent.com/googleapis/googleapis/master/google/api/annotations.proto
curl -s -o proto/google/api/http.proto -L https://raw.githubusercontent.com/googleapis/googleapis/master/google/api/http.proto
for PROTO in $PROTOS; do for PROTO in $PROTOS; do
echo $PROTO echo $PROTO
protoc -I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis -I./ -I$(dirname $PROTO) --go_out=plugins=grpc,paths=source_relative:. --micro_out=paths=source_relative:. $PROTO protoc -I./proto -I. -I$(dirname $PROTO) --go_out=plugins=grpc,paths=source_relative:. --micro_out=paths=source_relative:. $PROTO
done done
rm -r proto

View File

@ -42,6 +42,7 @@ func NewTestEndpoints() []*api.Endpoint {
Name: "Test.Call", Name: "Test.Call",
Path: []string{"/api/v0/test/call/{uuid}"}, Path: []string{"/api/v0/test/call/{uuid}"},
Method: []string{"POST"}, Method: []string{"POST"},
Body: "*",
Handler: "rpc", Handler: "rpc",
}, },
} }
@ -93,6 +94,7 @@ func RegisterTestHandler(s server.Server, hdlr TestHandler, opts ...server.Handl
Name: "Test.Call", Name: "Test.Call",
Path: []string{"/api/v0/test/call/{uuid}"}, Path: []string{"/api/v0/test/call/{uuid}"},
Method: []string{"POST"}, Method: []string{"POST"},
Body: "*",
Handler: "rpc", Handler: "rpc",
})) }))
return s.Handle(s.NewHandler(&Test{h}, opts...)) return s.Handle(s.NewHandler(&Test{h}, opts...))