LCOV - code coverage report
Current view: top level - source/common/config - null_grpc_mux_impl.h (source / functions) Hit Total Coverage
Test: coverage.dat Lines: 7 18 38.9 %
Date: 2024-01-05 06:35:25 Functions: 5 12 41.7 %

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include "envoy/config/grpc_mux.h"
       4             : 
       5             : namespace Envoy {
       6             : namespace Config {
       7             : 
       8             : // A placeholder class returned if no ADS is configured.
       9             : class NullGrpcMuxImpl : public GrpcMux,
      10             :                         GrpcStreamCallbacks<envoy::service::discovery::v3::DiscoveryResponse> {
      11             : public:
      12         100 :   void start() override {}
      13          70 :   ScopedResume pause(const std::string&) override {
      14          70 :     return std::make_unique<Cleanup>([] {});
      15          70 :   }
      16          70 :   ScopedResume pause(const std::vector<std::string>) override {
      17          70 :     return std::make_unique<Cleanup>([] {});
      18          70 :   }
      19             : 
      20             :   GrpcMuxWatchPtr addWatch(const std::string&, const absl::flat_hash_set<std::string>&,
      21             :                            SubscriptionCallbacks&, OpaqueResourceDecoderSharedPtr,
      22           0 :                            const SubscriptionOptions&) override {
      23           0 :     ExceptionUtil::throwEnvoyException("ADS must be configured to support an ADS config source");
      24           0 :   }
      25             : 
      26           0 :   void requestOnDemandUpdate(const std::string&, const absl::flat_hash_set<std::string>&) override {
      27           0 :     ENVOY_BUG(false, "unexpected request for on demand update");
      28           0 :   }
      29             : 
      30           0 :   EdsResourcesCacheOptRef edsResourcesCache() override { return absl::nullopt; }
      31             : 
      32           0 :   void onWriteable() override {}
      33           0 :   void onStreamEstablished() override {}
      34           0 :   void onEstablishmentFailure() override {}
      35             :   void onDiscoveryResponse(std::unique_ptr<envoy::service::discovery::v3::DiscoveryResponse>&&,
      36           0 :                            ControlPlaneStats&) override {}
      37             : };
      38             : 
      39             : } // namespace Config
      40             : } // namespace Envoy

Generated by: LCOV version 1.15