Add gogoproto annotations (#339)

Signed-off-by: Kuat Yessenov <kuat@google.com>
pull/344/head
Kuat 7 years ago committed by Matt Klein
parent 3f08c922a3
commit 9e967b37ee
  1. 4
      api/address.proto
  2. 3
      api/base.proto
  3. 7
      api/bootstrap.proto
  4. 13
      api/cds.proto
  5. 1
      api/filter/accesslog/accesslog.proto
  6. 4
      api/filter/fault.proto
  7. 8
      api/filter/network/http_connection_manager.proto
  8. 7
      api/rds.proto
  9. 3
      bazel/api_build_system.bzl
  10. 43
      bazel/repositories.bzl

@ -5,6 +5,7 @@ package envoy.api.v2;
import "google/protobuf/wrappers.proto";
import "validate/validate.proto";
import "gogoproto/gogo.proto";
// [#protodoc-title: Network addresses]
// [#v2-api-diff: Addresses now have .proto structure.]
@ -54,7 +55,8 @@ message SocketAddress {
message BindConfig {
// The address to bind to when creating a socket.
SocketAddress source_address = 1 [(validate.rules).message.required = true];
SocketAddress source_address = 1
[(validate.rules).message.required = true, (gogoproto.nullable) = false];
}
// Addresses specify either a logical or physical address and port, which are

@ -10,6 +10,7 @@ import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
import "validate/validate.proto";
import "gogoproto/gogo.proto";
// [#protodoc-title: Common types]
@ -176,7 +177,7 @@ message ApiConfigSource {
// will be cycled through if any kind of failure occurs.
repeated string cluster_name = 2 [(validate.rules).repeated .min_items = 1];
// For REST APIs, the delay between successive polls.
google.protobuf.Duration refresh_delay = 3;
google.protobuf.Duration refresh_delay = 3 [(gogoproto.stdduration) = true];
}
// Aggregated Discovery Service (ADS) options. This is currently empty, but when

@ -19,6 +19,7 @@ import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
import "validate/validate.proto";
import "gogoproto/gogo.proto";
// Bootstrap :ref:`configuration overview <config_overview_v2_bootstrap>`.
message Bootstrap {
@ -93,7 +94,7 @@ message Bootstrap {
// performance reasons Envoy latches counters and only flushes counters and
// gauges at a periodic interval. If not specified the default is 5000ms (5
// seconds).
google.protobuf.Duration stats_flush_interval = 7;
google.protobuf.Duration stats_flush_interval = 7 [(gogoproto.stdduration) = true];
// Optional watchdog configuration.
Watchdog watchdog = 8;
@ -112,7 +113,7 @@ message Bootstrap {
Runtime runtime = 11;
// Configuration for the local administration HTTP server.
Admin admin = 12 [(validate.rules).message.required = true];
Admin admin = 12 [(validate.rules).message.required = true, (gogoproto.nullable) = false];
}
// Configuration for the LightStep tracer.
@ -171,7 +172,7 @@ message Admin {
string profile_path = 2;
// The TCP address that the administration server will listen on.
Address address = 3 [(validate.rules).message.required = true];
Address address = 3 [(validate.rules).message.required = true, (gogoproto.nullable) = false];
}
// Cluster manager :ref:`architecture overview <arch_overview_cluster_manager>`.

@ -15,6 +15,7 @@ import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
import "validate/validate.proto";
import "gogoproto/gogo.proto";
// [#protodoc-title: Clusters and CDS]
@ -85,7 +86,11 @@ message Cluster {
EdsClusterConfig eds_cluster_config = 3;
// The timeout for new network connections to hosts in the cluster.
google.protobuf.Duration connect_timeout = 4 [(validate.rules).duration.gt = {}];
google.protobuf.Duration connect_timeout = 4 [
(validate.rules).duration.gt = {},
(gogoproto.stdduration) = true,
(gogoproto.nullable) = false
];
// Soft limit on size of the clusters connections read and write buffers. If
// unspecified, an implementation defined default is applied (1MiB).
@ -178,7 +183,8 @@ message Cluster {
// :ref:`STRICT_DNS<envoy_api_enum_value_Cluster.DiscoveryType.STRICT_DNS>`
// and :ref:`LOGICAL_DNS<envoy_api_enum_value_Cluster.DiscoveryType.LOGICAL_DNS>`
// this setting is ignored.
google.protobuf.Duration dns_refresh_rate = 16 [(validate.rules).duration.gt = {}];
google.protobuf.Duration dns_refresh_rate = 16
[(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
@ -296,7 +302,8 @@ message Cluster {
// value defaults to 5000ms. For cluster types other than
// :ref:`ORIGINAL_DST<envoy_api_enum_value_Cluster.DiscoveryType.ORIGINAL_DST>`
// this setting is ignored.
google.protobuf.Duration cleanup_interval = 20 [(validate.rules).duration.gt = {}];
google.protobuf.Duration cleanup_interval = 20
[(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.

@ -1,6 +1,7 @@
syntax = "proto3";
package envoy.api.v2.filter.accesslog;
option go_package = "accesslog";
import "api/address.proto";
import "api/base.proto";

@ -6,6 +6,7 @@ option go_package = "filter";
import "google/protobuf/duration.proto";
import "validate/validate.proto";
import "gogoproto/gogo.proto";
// [#protodoc-title: Common fault injection types]
@ -33,6 +34,7 @@ message FaultDelay {
// delay will be injected before a new request/operation. For TCP
// connections, the proxying of the connection upstream will be delayed
// for the specified period. This is required if type is FIXED.
google.protobuf.Duration fixed_delay = 3 [(validate.rules).duration.gt = {}];
google.protobuf.Duration fixed_delay = 3
[(validate.rules).duration.gt = {}, (gogoproto.stdduration) = true];
}
}

@ -13,6 +13,7 @@ import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
import "validate/validate.proto";
import "gogoproto/gogo.proto";
// [#protodoc-title: HTTP connection manager]
// HTTP connection manager :ref:`configuration overview <config_http_conn_man>`.
@ -102,7 +103,7 @@ message HttpConnectionManager {
// reached the connection will be closed. If the connection is an HTTP/2
// connection a drain sequence will occur prior to closing the connection. See
// :ref:`drain_timeout <envoy_api_field_filter.network.HttpConnectionManager.drain_timeout>`.
google.protobuf.Duration idle_timeout = 11;
google.protobuf.Duration idle_timeout = 11 [(gogoproto.stdduration) = true];
// The time that Envoy will wait between sending an HTTP/2 shutdown
// notification (GOAWAY frame with max stream ID) and a final GOAWAY frame.
@ -113,7 +114,7 @@ message HttpConnectionManager {
// both when a connection hits the idle timeout or during general server
// draining. The default grace period is 5000 milliseconds (5 seconds) if this
// option is not specified.
google.protobuf.Duration drain_timeout = 12;
google.protobuf.Duration drain_timeout = 12 [(gogoproto.stdduration) = true];
// Configuration for :ref:`HTTP access logs <arch_overview_access_logs>`
// emitted by the connection manager.
@ -181,7 +182,8 @@ message HttpConnectionManager {
message Rds {
// Configuration source specifier for RDS.
ConfigSource config_source = 1 [(validate.rules).message.required = true];
ConfigSource config_source = 1
[(validate.rules).message.required = true, (gogoproto.nullable) = false];
// The name of the route configuration. This name will be passed to the RDS
// API. This allows an Envoy configuration with multiple HTTP listeners (and

@ -11,6 +11,7 @@ import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
import "validate/validate.proto";
import "gogoproto/gogo.proto";
// [#protodoc-title: HTTP route management and RDS]
@ -375,7 +376,7 @@ message RouteAction {
// :ref:`config_http_filters_router_x-envoy-upstream-rq-timeout-ms`,
// :ref:`config_http_filters_router_x-envoy-upstream-rq-per-try-timeout-ms`, and the
// :ref:`retry overview <arch_overview_http_routing_retry>`.
google.protobuf.Duration timeout = 8;
google.protobuf.Duration timeout = 8 [(gogoproto.stdduration) = true];
// HTTP retry :ref:`architecture overview <arch_overview_http_routing_retry>`.
message RetryPolicy {
@ -400,7 +401,7 @@ message RouteAction {
// Consequently, when using a :ref:`5xx <config_http_filters_router_x-envoy-retry-on>` based
// retry policy, a request that times out will not be retried as the total timeout budget
// would have been exhausted.
google.protobuf.Duration per_try_timeout = 3;
google.protobuf.Duration per_try_timeout = 3 [(gogoproto.stdduration) = true];
}
// Indicates that the route has a retry policy.
@ -492,7 +493,7 @@ message RouteAction {
// If specified, a cookie with the TTL will be generated if the cookie is
// not present.
google.protobuf.Duration ttl = 2;
google.protobuf.Duration ttl = 2 [(gogoproto.stdduration) = true];
}
message ConnectionProperties {

@ -28,6 +28,7 @@ def api_py_proto_library(name, srcs = [], deps = [], has_services = 0):
deps = [_LibrarySuffix(d, _PY_SUFFIX) for d in deps] + [
"@com_lyft_protoc_gen_validate//validate:validate_py",
"@googleapis//:http_api_protos_py",
"@com_github_gogo_protobuf//:gogo_proto_py",
],
visibility = ["//visibility:public"],
)
@ -52,6 +53,7 @@ def api_proto_library(name, srcs = [], deps = [], has_services = 0, require_py =
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:wrappers_proto",
"@googleapis//:http_api_protos_proto",
"@com_github_gogo_protobuf//:gogo_proto",
"@com_lyft_protoc_gen_validate//validate:validate_proto",
],
visibility = ["//visibility:public"],
@ -67,6 +69,7 @@ def api_proto_library(name, srcs = [], deps = [], has_services = 0, require_py =
external_deps = [
"@com_google_protobuf//:cc_wkt_protos",
"@googleapis//:http_api_protos",
"@com_github_gogo_protobuf//:gogo_proto_cc",
],
visibility = ["//visibility:public"],
)

@ -1,4 +1,5 @@
GOOGLEAPIS_SHA = "5c6df0cd18c6a429eab739fb711c27f6e1393366" # May 14, 2017
GOGOPROTO_SHA = "342cbe0a04158f6dcb03ca0079991a51a4248c02" # Oct 7, 2017
PROMETHEUS_SHA = "6f3806018612930941127f2a7c6c453ba2c527d2" # Nov 02, 2017
PGV_GIT_SHA = "8e6aaf55f4954f1ef9d3ee2e8f5a50e79cc04f8f"
@ -59,6 +60,48 @@ py_proto_library(
""",
)
native.new_http_archive(
name = "com_github_gogo_protobuf",
strip_prefix = "protobuf-" + GOGOPROTO_SHA,
url = "https://github.com/gogo/protobuf/archive/" + GOGOPROTO_SHA + ".tar.gz",
build_file_content = """
load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library", "py_proto_library")
proto_library(
name = "gogo_proto",
srcs = [
"gogoproto/gogo.proto",
],
deps = [
"@com_google_protobuf//:descriptor_proto",
],
visibility = ["//visibility:public"],
)
cc_proto_library(
name = "gogo_proto_cc",
srcs = [
"gogoproto/gogo.proto",
],
default_runtime = "@com_google_protobuf//:protobuf",
protoc = "@com_google_protobuf//:protoc",
deps = ["@com_google_protobuf//:cc_wkt_protos"],
visibility = ["//visibility:public"],
)
py_proto_library(
name = "gogo_proto_py",
srcs = [
"gogoproto/gogo.proto",
],
default_runtime = "@com_google_protobuf//:protobuf_python",
protoc = "@com_google_protobuf//:protoc",
visibility = ["//visibility:public"],
deps = ["@com_google_protobuf//:protobuf_python"],
)
""",
)
native.new_http_archive(
name = "promotheus_metrics_model",
strip_prefix = "client_model-" + PROMETHEUS_SHA,

Loading…
Cancel
Save