From 16de96befe60601ad747c33f490dc7124f374590 Mon Sep 17 00:00:00 2001 From: ZHANG Dapeng Date: Wed, 5 Jun 2019 10:13:19 -0700 Subject: [PATCH] xds: Add gogoproto dependency to xds The generated grpc services are not changed. --- xds/build.gradle | 1 + xds/third_party/envoy/import.sh | 27 ---- .../main/proto/envoy/api/v2/auth/cert.proto | 4 +- .../src/main/proto/envoy/api/v2/cds.proto | 14 +- .../api/v2/cluster/circuit_breaker.proto | 4 +- .../api/v2/cluster/outlier_detection.proto | 4 +- .../proto/envoy/api/v2/core/address.proto | 7 +- .../main/proto/envoy/api/v2/core/base.proto | 9 +- .../envoy/api/v2/core/config_source.proto | 8 +- .../envoy/api/v2/core/grpc_service.proto | 4 +- .../envoy/api/v2/core/health_check.proto | 10 +- .../proto/envoy/api/v2/core/protocol.proto | 6 +- .../main/proto/envoy/api/v2/discovery.proto | 10 +- .../src/main/proto/envoy/api/v2/eds.proto | 8 +- .../envoy/api/v2/endpoint/endpoint.proto | 6 +- .../envoy/api/v2/endpoint/load_report.proto | 2 +- .../src/main/proto/envoy/type/percent.proto | 4 +- .../src/main/proto/envoy/type/range.proto | 4 +- xds/third_party/gogoproto/LICENSE | 35 +++++ xds/third_party/gogoproto/import.sh | 49 ++++++ .../src/main/proto/gogoproto/gogo.proto | 144 ++++++++++++++++++ 21 files changed, 284 insertions(+), 76 deletions(-) create mode 100644 xds/third_party/gogoproto/LICENSE create mode 100755 xds/third_party/gogoproto/import.sh create mode 100644 xds/third_party/gogoproto/src/main/proto/gogoproto/gogo.proto diff --git a/xds/build.gradle b/xds/build.gradle index 903b13d93d..f353e5a008 100644 --- a/xds/build.gradle +++ b/xds/build.gradle @@ -44,6 +44,7 @@ sourceSets { main { proto { srcDir 'third_party/envoy/src/main/proto' + srcDir 'third_party/gogoproto/src/main/proto' srcDir 'third_party/protoc-gen-validate/src/main/proto' } } diff --git a/xds/third_party/envoy/import.sh b/xds/third_party/envoy/import.sh index 24ef8b608a..d5ef818d08 100755 --- a/xds/third_party/envoy/import.sh +++ b/xds/third_party/envoy/import.sh @@ -69,33 +69,6 @@ do mkdir -p "$(dirname "${file}")" cp -p "${tmpdir}/${SOURCE_PROTO_BASE_DIR}/${file}" "${file}" done - -# DO NOT TOUCH! The following section is upstreamed with an internal script. - -# See google internal third_party/envoy/envoy-update.sh -# =========================================================================== -# Fix up proto imports and remove references to gogoproto. -# =========================================================================== -for f in "${FILES[@]}" -do - commands=( - # Import mangling. - -e 's#import "gogoproto/gogo.proto";##' - # Remove references to gogo.proto extensions. - -e 's#option (gogoproto\.[a-z_]\+) = \(true\|false\);##' - -e 's#\(, \)\?(gogoproto\.[a-z_]\+) = \(true\|false\),\?##' - # gogoproto removal can result in empty brackets. - -e 's# \[\]##' - # gogoproto removal can result in four spaces on a line by itself. - -e '/^ $/d' - ) - sed -i "${commands[@]}" "$f" - - # gogoproto removal can leave a comma on the last element in a list. - # This needs to run separately after all the commands above have finished - # since it is multi-line and rewrites the output of the above patterns. - sed -i -e '$!N; s#\(.*\),\([[:space:]]*\];\)#\1\2#; t; P; D;' "$f" -done popd rm -rf "$tmpdir" diff --git a/xds/third_party/envoy/src/main/proto/envoy/api/v2/auth/cert.proto b/xds/third_party/envoy/src/main/proto/envoy/api/v2/auth/cert.proto index 86a1fcd93a..526caf2928 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/api/v2/auth/cert.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/api/v2/auth/cert.proto @@ -13,9 +13,9 @@ import "envoy/api/v2/core/config_source.proto"; import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; +import "gogoproto/gogo.proto"; - - +option (gogoproto.equal_all) = true; // [#protodoc-title: Common TLS configuration] diff --git a/xds/third_party/envoy/src/main/proto/envoy/api/v2/cds.proto b/xds/third_party/envoy/src/main/proto/envoy/api/v2/cds.proto index aa8fce305b..74ae29fb11 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/api/v2/cds.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/api/v2/cds.proto @@ -27,10 +27,10 @@ import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; +import "gogoproto/gogo.proto"; - - - +option (gogoproto.equal_all) = true; +option (gogoproto.stable_marshaler_all) = true; // Return list of all clusters this proxy will load balance to. service ClusterDiscoveryService { @@ -127,7 +127,9 @@ message Cluster { // The timeout for new network connections to hosts in the cluster. google.protobuf.Duration connect_timeout = 4 [ - (validate.rules).duration.gt = {} + (validate.rules).duration.gt = {}, + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false ]; // Soft limit on size of the cluster’s connections read and write buffers. If @@ -266,7 +268,7 @@ message Cluster { // and :ref:`LOGICAL_DNS` // this setting is ignored. google.protobuf.Duration dns_refresh_rate = 16 - [(validate.rules).duration.gt = {}]; + [(validate.rules).duration.gt = {}, (gogoproto.stdduration) = true]; // When V4_ONLY is selected, the DNS resolver will only perform a lookup for // addresses in the IPv4 family. If V6_ONLY is selected, the DNS resolver will @@ -320,7 +322,7 @@ message Cluster { // :ref:`ORIGINAL_DST` // this setting is ignored. google.protobuf.Duration cleanup_interval = 20 - [(validate.rules).duration.gt = {}]; + [(validate.rules).duration.gt = {}, (gogoproto.stdduration) = true]; // Optional configuration used to bind newly established upstream connections. // This overrides any bind_config specified in the bootstrap proto. diff --git a/xds/third_party/envoy/src/main/proto/envoy/api/v2/cluster/circuit_breaker.proto b/xds/third_party/envoy/src/main/proto/envoy/api/v2/cluster/circuit_breaker.proto index 53131a35b7..f219fa07b4 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/api/v2/cluster/circuit_breaker.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/api/v2/cluster/circuit_breaker.proto @@ -12,9 +12,9 @@ import "envoy/api/v2/core/base.proto"; import "google/protobuf/wrappers.proto"; +import "gogoproto/gogo.proto"; - - +option (gogoproto.equal_all) = true; // [#protodoc-title: Circuit breakers] diff --git a/xds/third_party/envoy/src/main/proto/envoy/api/v2/cluster/outlier_detection.proto b/xds/third_party/envoy/src/main/proto/envoy/api/v2/cluster/outlier_detection.proto index 4ab8f3a6e2..cd33cde1ec 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/api/v2/cluster/outlier_detection.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/api/v2/cluster/outlier_detection.proto @@ -11,9 +11,9 @@ import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; +import "gogoproto/gogo.proto"; - - +option (gogoproto.equal_all) = true; // [#protodoc-title: Outlier detection] diff --git a/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/address.proto b/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/address.proto index b90d09d745..3d597f56be 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/address.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/address.proto @@ -11,9 +11,9 @@ import "envoy/api/v2/core/base.proto"; import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; +import "gogoproto/gogo.proto"; - - +option (gogoproto.equal_all) = true; // [#protodoc-title: Network addresses] @@ -27,6 +27,7 @@ message Pipe { message SocketAddress { enum Protocol { + option (gogoproto.goproto_enum_prefix) = false; TCP = 0; // [#not-implemented-hide:] UDP = 1; @@ -83,7 +84,7 @@ message TcpKeepalive { message BindConfig { // The address to bind to when creating a socket. SocketAddress source_address = 1 - [(validate.rules).message.required = true]; + [(validate.rules).message.required = true, (gogoproto.nullable) = false]; // Whether to set the *IP_FREEBIND* option when creating the socket. When this // flag is set to true, allows the :ref:`source_address diff --git a/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/base.proto b/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/base.proto index 46aca8085e..6b4e931cfa 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/base.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/base.proto @@ -12,12 +12,12 @@ import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; - +import "gogoproto/gogo.proto"; import "envoy/type/percent.proto"; - - +option (gogoproto.equal_all) = true; +option (gogoproto.stable_marshaler_all) = true; // [#protodoc-title: Common types] @@ -130,7 +130,7 @@ enum RoutingPriority { // HTTP request method. enum RequestMethod { - + option (gogoproto.goproto_enum_prefix) = false; METHOD_UNSPECIFIED = 0; GET = 1; HEAD = 2; @@ -223,6 +223,7 @@ message SocketOption { bytes buf_value = 5; } enum SocketState { + option (gogoproto.goproto_enum_prefix) = false; // Socket options are applied after socket creation but before binding the socket to a port STATE_PREBIND = 0; // Socket options are applied after binding the socket to a port but before calling listen() diff --git a/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/config_source.proto b/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/config_source.proto index bed90821f1..8b6014dcbf 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/config_source.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/config_source.proto @@ -12,9 +12,9 @@ import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; +import "gogoproto/gogo.proto"; - - +option (gogoproto.equal_all) = true; // [#protodoc-title: Configuration sources] @@ -56,11 +56,11 @@ message ApiConfigSource { repeated GrpcService grpc_services = 4; // For REST APIs, the delay between successive polls. - google.protobuf.Duration refresh_delay = 3; + google.protobuf.Duration refresh_delay = 3 [(gogoproto.stdduration) = true]; // For REST APIs, the request timeout. If not set, a default value of 1s will be used. google.protobuf.Duration request_timeout = 5 - [(validate.rules).duration.gt.seconds = 0]; + [(validate.rules).duration.gt.seconds = 0, (gogoproto.stdduration) = true]; // For GRPC APIs, the rate limit settings. If present, discovery requests made by Envoy will be // rate limited. diff --git a/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/grpc_service.proto b/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/grpc_service.proto index 24a5b4244a..404791e1b3 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/grpc_service.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/grpc_service.proto @@ -14,9 +14,9 @@ import "google/protobuf/struct.proto"; import "google/protobuf/empty.proto"; import "validate/validate.proto"; +import "gogoproto/gogo.proto"; - - +option (gogoproto.equal_all) = true; // [#protodoc-title: gRPC services] diff --git a/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/health_check.proto b/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/health_check.proto index dbc69479bf..edbcef7b52 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/health_check.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/health_check.proto @@ -15,9 +15,9 @@ import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; +import "gogoproto/gogo.proto"; - - +option (gogoproto.equal_all) = true; // [#protodoc-title: Health check] // * Health checking :ref:`architecture overview `. @@ -31,7 +31,8 @@ message HealthCheck { (validate.rules).duration = { required: true, gt: {seconds: 0} - } + }, + (gogoproto.stdduration) = true ]; // The interval between health checks. @@ -39,7 +40,8 @@ message HealthCheck { (validate.rules).duration = { required: true, gt: {seconds: 0} - } + }, + (gogoproto.stdduration) = true ]; // An optional jitter amount in milliseconds. If specified, Envoy will start health diff --git a/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/protocol.proto b/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/protocol.proto index 3115df3cf0..200b8517ab 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/protocol.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/protocol.proto @@ -12,9 +12,9 @@ import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; +import "gogoproto/gogo.proto"; - - +option (gogoproto.equal_all) = true; // [#protodoc-title: Protocol options] @@ -27,7 +27,7 @@ message HttpProtocolOptions { // period in which there are no active requests. If not set, there is no idle timeout. When the // idle timeout is reached the connection will be closed. Note that request based timeouts mean // that HTTP/2 PINGs will not keep the connection alive. - google.protobuf.Duration idle_timeout = 1; + google.protobuf.Duration idle_timeout = 1 [(gogoproto.stdduration) = true]; } message Http1ProtocolOptions { diff --git a/xds/third_party/envoy/src/main/proto/envoy/api/v2/discovery.proto b/xds/third_party/envoy/src/main/proto/envoy/api/v2/discovery.proto index 6345dc97fe..8743cc150e 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/api/v2/discovery.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/api/v2/discovery.proto @@ -11,10 +11,10 @@ import "envoy/api/v2/core/base.proto"; import "google/protobuf/any.proto"; import "google/rpc/status.proto"; +import "gogoproto/gogo.proto"; - - - +option (gogoproto.equal_all) = true; +option (gogoproto.stable_marshaler_all) = true; // [#protodoc-title: Common discovery API components] @@ -65,7 +65,7 @@ message DiscoveryResponse { string version_info = 1; // The response resources. These resources are typed and depend on the API being called. - repeated google.protobuf.Any resources = 2; + repeated google.protobuf.Any resources = 2 [(gogoproto.nullable) = false]; // [#not-implemented-hide:] // Canary is used to support two Envoy command line flags: @@ -189,7 +189,7 @@ message DeltaDiscoveryResponse { // The response resources. These are typed resources that match the type url // in the DeltaDiscoveryRequest. - repeated Resource resources = 2; + repeated Resource resources = 2 [(gogoproto.nullable) = false]; // Resources names of resources that have be deleted and to be removed from the xDS Client. // Removed resources for missing resources can be ignored. diff --git a/xds/third_party/envoy/src/main/proto/envoy/api/v2/eds.proto b/xds/third_party/envoy/src/main/proto/envoy/api/v2/eds.proto index 72a4a1cd1e..2f8fd7a418 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/api/v2/eds.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/api/v2/eds.proto @@ -15,12 +15,12 @@ import "envoy/type/percent.proto"; import "google/api/annotations.proto"; import "validate/validate.proto"; - +import "gogoproto/gogo.proto"; import "google/protobuf/wrappers.proto"; import "google/protobuf/duration.proto"; - - +option (gogoproto.equal_all) = true; +option (gogoproto.stable_marshaler_all) = true; // [#protodoc-title: EDS] // Endpoint discovery :ref:`architecture overview ` @@ -56,7 +56,7 @@ message ClusterLoadAssignment { string cluster_name = 1 [(validate.rules).string.min_bytes = 1]; // List of endpoints to load balance to. - repeated endpoint.LocalityLbEndpoints endpoints = 2; + repeated endpoint.LocalityLbEndpoints endpoints = 2 [(gogoproto.nullable) = false]; // Map of named endpoints that can be referenced in LocalityLbEndpoints. map named_endpoints = 5; diff --git a/xds/third_party/envoy/src/main/proto/envoy/api/v2/endpoint/endpoint.proto b/xds/third_party/envoy/src/main/proto/envoy/api/v2/endpoint/endpoint.proto index 1bdd85280e..28136c2b86 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/api/v2/endpoint/endpoint.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/api/v2/endpoint/endpoint.proto @@ -14,9 +14,9 @@ import "envoy/api/v2/core/health_check.proto"; import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; +import "gogoproto/gogo.proto"; - - +option (gogoproto.equal_all) = true; // [#protodoc-title: Endpoints] @@ -101,7 +101,7 @@ message LocalityLbEndpoints { core.Locality locality = 1; // The group of endpoints belonging to the locality specified. - repeated LbEndpoint lb_endpoints = 2; + repeated LbEndpoint lb_endpoints = 2 [(gogoproto.nullable) = false]; // Optional: Per priority/region/zone/sub_zone weight - range 1-128. The load // balancing weight for a locality is divided by the sum of the weights of all diff --git a/xds/third_party/envoy/src/main/proto/envoy/api/v2/endpoint/load_report.proto b/xds/third_party/envoy/src/main/proto/envoy/api/v2/endpoint/load_report.proto index 59773baaf8..df3fd6071e 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/api/v2/endpoint/load_report.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/api/v2/endpoint/load_report.proto @@ -13,7 +13,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "validate/validate.proto"; - +import "gogoproto/gogo.proto"; // These are stats Envoy reports to GLB every so often. Report frequency is // defined by diff --git a/xds/third_party/envoy/src/main/proto/envoy/type/percent.proto b/xds/third_party/envoy/src/main/proto/envoy/type/percent.proto index 4a070a2a8c..551e93bfdd 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/type/percent.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/type/percent.proto @@ -7,9 +7,9 @@ option java_multiple_files = true; option java_package = "io.envoyproxy.envoy.type"; import "validate/validate.proto"; +import "gogoproto/gogo.proto"; - - +option (gogoproto.equal_all) = true; // [#protodoc-title: Percent] diff --git a/xds/third_party/envoy/src/main/proto/envoy/type/range.proto b/xds/third_party/envoy/src/main/proto/envoy/type/range.proto index 251b5febd1..e64b71e440 100644 --- a/xds/third_party/envoy/src/main/proto/envoy/type/range.proto +++ b/xds/third_party/envoy/src/main/proto/envoy/type/range.proto @@ -7,9 +7,9 @@ option java_multiple_files = true; option java_package = "io.envoyproxy.envoy.type"; option go_package = "envoy_type"; +import "gogoproto/gogo.proto"; - - +option (gogoproto.equal_all) = true; // [#protodoc-title: Range] diff --git a/xds/third_party/gogoproto/LICENSE b/xds/third_party/gogoproto/LICENSE new file mode 100644 index 0000000000..f57de90da8 --- /dev/null +++ b/xds/third_party/gogoproto/LICENSE @@ -0,0 +1,35 @@ +Copyright (c) 2013, The GoGo Authors. All rights reserved. + +Protocol Buffers for Go with Gadgets + +Go support for Protocol Buffers - Google's data interchange format + +Copyright 2010 The Go Authors. All rights reserved. +https://github.com/golang/protobuf + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/xds/third_party/gogoproto/import.sh b/xds/third_party/gogoproto/import.sh new file mode 100755 index 0000000000..5ffb4da619 --- /dev/null +++ b/xds/third_party/gogoproto/import.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Copyright 2019 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Update BRANCH then in this directory run ./import.sh + +set -e +BRANCH=v1.2.0 +GIT_REPO="https://github.com/gogo/protobuf.git" +GIT_BASE_DIR=protobuf +SOURCE_PROTO_BASE_DIR=protobuf +TARGET_PROTO_BASE_DIR=src/main/proto +FILES=( +gogoproto/gogo.proto +) + +# clone the gogoproto github repo in a tmp directory +tmpdir="$(mktemp -d)" +pushd "${tmpdir}" +rm -rf "$GIT_BASE_DIR" +git clone -b $BRANCH $GIT_REPO +cd "$GIT_BASE_DIR" +popd + +cp -p "${tmpdir}/${GIT_BASE_DIR}/LICENSE" LICENSE + +mkdir -p "${TARGET_PROTO_BASE_DIR}" +pushd "${TARGET_PROTO_BASE_DIR}" + +# copy proto files to project directory +for file in "${FILES[@]}" +do + mkdir -p "$(dirname "${file}")" + cp -p "${tmpdir}/${SOURCE_PROTO_BASE_DIR}/${file}" "${file}" +done +popd + +rm -rf "$tmpdir" diff --git a/xds/third_party/gogoproto/src/main/proto/gogoproto/gogo.proto b/xds/third_party/gogoproto/src/main/proto/gogoproto/gogo.proto new file mode 100644 index 0000000000..b80c85653f --- /dev/null +++ b/xds/third_party/gogoproto/src/main/proto/gogoproto/gogo.proto @@ -0,0 +1,144 @@ +// Protocol Buffers for Go with Gadgets +// +// Copyright (c) 2013, The GoGo Authors. All rights reserved. +// http://github.com/gogo/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto2"; +package gogoproto; + +import "google/protobuf/descriptor.proto"; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "GoGoProtos"; +option go_package = "github.com/gogo/protobuf/gogoproto"; + +extend google.protobuf.EnumOptions { + optional bool goproto_enum_prefix = 62001; + optional bool goproto_enum_stringer = 62021; + optional bool enum_stringer = 62022; + optional string enum_customname = 62023; + optional bool enumdecl = 62024; +} + +extend google.protobuf.EnumValueOptions { + optional string enumvalue_customname = 66001; +} + +extend google.protobuf.FileOptions { + optional bool goproto_getters_all = 63001; + optional bool goproto_enum_prefix_all = 63002; + optional bool goproto_stringer_all = 63003; + optional bool verbose_equal_all = 63004; + optional bool face_all = 63005; + optional bool gostring_all = 63006; + optional bool populate_all = 63007; + optional bool stringer_all = 63008; + optional bool onlyone_all = 63009; + + optional bool equal_all = 63013; + optional bool description_all = 63014; + optional bool testgen_all = 63015; + optional bool benchgen_all = 63016; + optional bool marshaler_all = 63017; + optional bool unmarshaler_all = 63018; + optional bool stable_marshaler_all = 63019; + + optional bool sizer_all = 63020; + + optional bool goproto_enum_stringer_all = 63021; + optional bool enum_stringer_all = 63022; + + optional bool unsafe_marshaler_all = 63023; + optional bool unsafe_unmarshaler_all = 63024; + + optional bool goproto_extensions_map_all = 63025; + optional bool goproto_unrecognized_all = 63026; + optional bool gogoproto_import = 63027; + optional bool protosizer_all = 63028; + optional bool compare_all = 63029; + optional bool typedecl_all = 63030; + optional bool enumdecl_all = 63031; + + optional bool goproto_registration = 63032; + optional bool messagename_all = 63033; + + optional bool goproto_sizecache_all = 63034; + optional bool goproto_unkeyed_all = 63035; +} + +extend google.protobuf.MessageOptions { + optional bool goproto_getters = 64001; + optional bool goproto_stringer = 64003; + optional bool verbose_equal = 64004; + optional bool face = 64005; + optional bool gostring = 64006; + optional bool populate = 64007; + optional bool stringer = 67008; + optional bool onlyone = 64009; + + optional bool equal = 64013; + optional bool description = 64014; + optional bool testgen = 64015; + optional bool benchgen = 64016; + optional bool marshaler = 64017; + optional bool unmarshaler = 64018; + optional bool stable_marshaler = 64019; + + optional bool sizer = 64020; + + optional bool unsafe_marshaler = 64023; + optional bool unsafe_unmarshaler = 64024; + + optional bool goproto_extensions_map = 64025; + optional bool goproto_unrecognized = 64026; + + optional bool protosizer = 64028; + optional bool compare = 64029; + + optional bool typedecl = 64030; + + optional bool messagename = 64033; + + optional bool goproto_sizecache = 64034; + optional bool goproto_unkeyed = 64035; +} + +extend google.protobuf.FieldOptions { + optional bool nullable = 65001; + optional bool embed = 65002; + optional string customtype = 65003; + optional string customname = 65004; + optional string jsontag = 65005; + optional string moretags = 65006; + optional string casttype = 65007; + optional string castkey = 65008; + optional string castvalue = 65009; + + optional bool stdtime = 65010; + optional bool stdduration = 65011; + optional bool wktpointer = 65012; + +}