/proc/self/cwd/source/extensions/load_balancing_policies/cluster_provided/config.h
Line | Count | Source (jump to first uncovered line) |
1 | | #pragma once |
2 | | |
3 | | #include <memory> |
4 | | |
5 | | #include "envoy/extensions/load_balancing_policies/cluster_provided/v3/cluster_provided.pb.h" |
6 | | #include "envoy/upstream/load_balancer.h" |
7 | | |
8 | | #include "source/common/upstream/load_balancer_factory_base.h" |
9 | | |
10 | | namespace Envoy { |
11 | | namespace Extensions { |
12 | | namespace LoadBalancingPolices { |
13 | | namespace ClusterProvided { |
14 | | |
15 | | class ClusterProvidedLbConfig : public Upstream::LoadBalancerConfig { |
16 | | public: |
17 | 0 | ClusterProvidedLbConfig() = default; |
18 | | }; |
19 | | |
20 | | class Factory |
21 | | : public Upstream::TypedLoadBalancerFactoryBase< |
22 | | envoy::extensions::load_balancing_policies::cluster_provided::v3::ClusterProvided> { |
23 | | public: |
24 | 26 | Factory() : TypedLoadBalancerFactoryBase("envoy.load_balancing_policies.cluster_provided") {} |
25 | | |
26 | | Upstream::ThreadAwareLoadBalancerPtr create(OptRef<const Upstream::LoadBalancerConfig> lb_config, |
27 | | const Upstream::ClusterInfo& cluster_info, |
28 | | const Upstream::PrioritySet& priority_set, |
29 | | Runtime::Loader& runtime, |
30 | | Random::RandomGenerator& random, |
31 | | TimeSource& time_source) override; |
32 | | |
33 | | Upstream::LoadBalancerConfigPtr loadConfig(const Protobuf::Message&, |
34 | 0 | ProtobufMessage::ValidationVisitor&) override { |
35 | 0 | return std::make_unique<ClusterProvidedLbConfig>(); |
36 | 0 | } |
37 | | }; |
38 | | |
39 | | DECLARE_FACTORY(Factory); |
40 | | |
41 | | } // namespace ClusterProvided |
42 | | } // namespace LoadBalancingPolices |
43 | | } // namespace Extensions |
44 | | } // namespace Envoy |