forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lds_api.h
56 lines (47 loc) · 2.06 KB
/
lds_api.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#include <functional>
#include "envoy/config/core/v3/config_source.pb.h"
#include "envoy/config/listener/v3/listener.pb.h"
#include "envoy/config/listener/v3/listener.pb.validate.h"
#include "envoy/config/subscription.h"
#include "envoy/config/subscription_factory.h"
#include "envoy/init/manager.h"
#include "envoy/server/listener_manager.h"
#include "envoy/service/discovery/v3/discovery.pb.h"
#include "envoy/stats/scope.h"
#include "common/common/logger.h"
#include "common/config/subscription_base.h"
#include "common/init/target_impl.h"
namespace Envoy {
namespace Server {
/**
* LDS API implementation that fetches via Subscription.
*/
class LdsApiImpl : public LdsApi,
Envoy::Config::SubscriptionBase<envoy::config::listener::v3::Listener>,
Logger::Loggable<Logger::Id::upstream> {
public:
LdsApiImpl(const envoy::config::core::v3::ConfigSource& lds_config,
const xds::core::v3::ResourceLocator* lds_resources_locator,
Upstream::ClusterManager& cm, Init::Manager& init_manager, Stats::Scope& scope,
ListenerManager& lm, ProtobufMessage::ValidationVisitor& validation_visitor);
// Server::LdsApi
std::string versionInfo() const override { return system_version_info_; }
private:
// Config::SubscriptionCallbacks
void onConfigUpdate(const std::vector<Config::DecodedResourceRef>& resources,
const std::string& version_info) override;
void onConfigUpdate(const std::vector<Config::DecodedResourceRef>& added_resources,
const Protobuf::RepeatedPtrField<std::string>& removed_resources,
const std::string& system_version_info) override;
void onConfigUpdateFailed(Envoy::Config::ConfigUpdateFailureReason reason,
const EnvoyException* e) override;
Config::SubscriptionPtr subscription_;
std::string system_version_info_;
ListenerManager& listener_manager_;
Stats::ScopePtr scope_;
Upstream::ClusterManager& cm_;
Init::TargetImpl init_target_;
};
} // namespace Server
} // namespace Envoy