api: remove cc_generic_services dependency. (#96)

We can dynamically discover service/method descriptors in Envoy, so we
don't need to generate any C++ stubs for this. This simplifies the
Google import and removes an unnecessary build output.
pull/94/head
htuch 8 years ago committed by GitHub
parent 1b4ac577d1
commit 89c068ddbd
  1. 2
      api/cds.proto
  2. 2
      api/eds.proto
  3. 2
      api/hds.proto
  4. 2
      api/lds.proto
  5. 2
      api/rds.proto
  6. 2
      api/rlds.proto
  7. 31
      test/build/build_test.cc

@ -11,8 +11,6 @@ import "google/api/annotations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
option cc_generic_services = true;
// Return list of all clusters this proxy will load balance to.
service ClusterDiscoveryService {
rpc StreamClusters(stream DiscoveryRequest)

@ -9,8 +9,6 @@ import "google/api/annotations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
option cc_generic_services = true;
service EndpointDiscoveryService {
// The resource_names field in DiscoveryRequest specifies a list of clusters
// to subscribe to updates for.

@ -8,8 +8,6 @@ import "api/health_check.proto";
import "google/api/annotations.proto";
import "google/protobuf/duration.proto";
option cc_generic_services = true;
// HDS is Health Discovery Service. It compliments Envoys health checking
// service by designating this Envoy to be a healthchecker for a subset of hosts
// in the cluster. The status of these health checks will be reported to the

@ -14,8 +14,6 @@ import "google/api/annotations.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
option cc_generic_services = true;
// The Envoy instance initiates an RPC at startup to discover a list of
// listeners. Updates are delivered via streaming from the LDS server and
// consist of a complete update of all listeners. Existing connections will be

@ -12,8 +12,6 @@ import "google/api/annotations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
option cc_generic_services = true;
// The resource_names field in DiscoveryRequest specifies a route configuration.
// This allows an Envoy configuration with multiple HTTP listeners (and
// associated HTTP connection manager filters) to use different route

@ -2,8 +2,6 @@ syntax = "proto3";
option go_package = "ratelimit";
option cc_generic_services = true;
package envoy.api.v2;
service RateLimitDiscoveryService {

@ -1,3 +1,6 @@
#include <iostream>
#include <cstdlib>
#include "api/cds.pb.h"
#include "api/eds.pb.h"
#include "api/hds.pb.h"
@ -7,10 +10,26 @@
// Basic C++ build/link validation for the v2 xDS APIs.
int main(int argc, char *argv[]) {
envoy::api::v2::ClusterDiscoveryService::descriptor();
envoy::api::v2::EndpointDiscoveryService::descriptor();
envoy::api::v2::HealthDiscoveryService::descriptor();
envoy::api::v2::ListenerDiscoveryService::descriptor();
envoy::api::v2::RateLimitDiscoveryService::descriptor();
envoy::api::v2::RouteDiscoveryService::descriptor();
const auto methods = {
"envoy.api.v2.ClusterDiscoveryService.FetchClusters",
"envoy.api.v2.ClusterDiscoveryService.StreamClusters",
"envoy.api.v2.EndpointDiscoveryService.FetchEndpoints",
"envoy.api.v2.EndpointDiscoveryService.StreamEndpoints",
"envoy.api.v2.HealthDiscoveryService.FetchHealthCheck",
"envoy.api.v2.HealthDiscoveryService.StreamHealthCheck",
"envoy.api.v2.ListenerDiscoveryService.FetchListeners",
"envoy.api.v2.ListenerDiscoveryService.StreamListeners",
"envoy.api.v2.RouteDiscoveryService.FetchRoutes",
"envoy.api.v2.RouteDiscoveryService.StreamRoutes",
"envoy.api.v2.RateLimitDiscoveryService.ShouldRateLimit",
};
for (const auto& method : methods) {
if (google::protobuf::DescriptorPool::generated_pool()->FindMethodByName(method) == nullptr) {
std::cout << "Unable to find method descriptor for " << method << std::endl;
exit(EXIT_FAILURE);
}
}
exit(EXIT_SUCCESS);
}

Loading…
Cancel
Save