test_lb_policies.h
Go to the documentation of this file.
1 //
2 // Copyright 2018 gRPC authors.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #ifndef GRPC_TEST_CORE_UTIL_TEST_LB_POLICIES_H
18 #define GRPC_TEST_CORE_UTIL_TEST_LB_POLICIES_H
19 
21 
22 namespace grpc_core {
23 
24 using MetadataVector = std::vector<std::pair<std::string, std::string>>;
25 
26 struct PickArgsSeen {
29 };
30 
32 
33 // Registers an LB policy called "test_pick_args_lb" that passes the args
34 // passed to SubchannelPicker::Pick() to cb.
36  TestPickArgsCallback cb, const char* delegate_policy_name = "pick_first");
37 
42 };
43 
46 
47 // Registers an LB policy called "intercept_trailing_metadata_lb" that
48 // invokes cb when trailing metadata is received for each call.
51 
53 
54 // Registers an LB policy called "address_test_lb" that invokes cb for each
55 // address used to create a subchannel.
57 
58 // Registers an LB policy called "fixed_address_lb" that provides a
59 // single subchannel whose address is in its configuration.
61 
64 
65 // Registers an LB policy called "oob_backend_metric_test_lb" that invokes
66 // cb for each OOB backend metric report on each subchannel.
69 
70 } // namespace grpc_core
71 
72 #endif // GRPC_TEST_CORE_UTIL_TEST_LB_POLICIES_H
grpc_core::TestPickArgsCallback
std::function< void(const PickArgsSeen &)> TestPickArgsCallback
Definition: test_lb_policies.h:31
grpc_core::BackendMetricData
Definition: backend_metric_data.h:31
grpc_core
Definition: call_metric_recorder.h:31
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
lb_policy.h
grpc_core::ServerAddress
Definition: server_address.h:49
grpc_core::RegisterOobBackendMetricTestLoadBalancingPolicy
void RegisterOobBackendMetricTestLoadBalancingPolicy(OobBackendMetricCallback cb)
Definition: test_lb_policies.cc:670
grpc_core::RegisterAddressTestLoadBalancingPolicy
void RegisterAddressTestLoadBalancingPolicy(AddressTestCallback cb)
Definition: test_lb_policies.cc:660
grpc_core::MetadataVector
std::vector< std::pair< std::string, std::string > > MetadataVector
Definition: test_lb_policies.h:24
grpc_core::PickArgsSeen
Definition: test_lb_policies.h:26
grpc_core::PickArgsSeen::metadata
MetadataVector metadata
Definition: test_lb_policies.h:28
grpc_core::TrailingMetadataArgsSeen::metadata
MetadataVector metadata
Definition: test_lb_policies.h:41
grpc_core::RegisterInterceptRecvTrailingMetadataLoadBalancingPolicy
void RegisterInterceptRecvTrailingMetadataLoadBalancingPolicy(InterceptRecvTrailingMetadataCallback cb)
Definition: test_lb_policies.cc:654
grpc_core::RegisterTestPickArgsLoadBalancingPolicy
void RegisterTestPickArgsLoadBalancingPolicy(TestPickArgsCallback cb, const char *delegate_policy_name)
Definition: test_lb_policies.cc:647
grpc_core::TrailingMetadataArgsSeen::backend_metric_data
const BackendMetricData * backend_metric_data
Definition: test_lb_policies.h:40
grpc_core::OobBackendMetricCallback
std::function< void(ServerAddress, const BackendMetricData &)> OobBackendMetricCallback
Definition: test_lb_policies.h:63
grpc_core::TrailingMetadataArgsSeen
Definition: test_lb_policies.h:38
absl::Status
Definition: third_party/abseil-cpp/absl/status/status.h:424
grpc_core::PickArgsSeen::path
std::string path
Definition: test_lb_policies.h:27
grpc_core::AddressTestCallback
std::function< void(const ServerAddress &)> AddressTestCallback
Definition: test_lb_policies.h:52
grpc_core::RegisterFixedAddressLoadBalancingPolicy
void RegisterFixedAddressLoadBalancingPolicy()
Definition: test_lb_policies.cc:665
function
std::function< bool(GrpcTool *, int, const char **, const CliCredentials &, GrpcToolOutputCallback)> function
Definition: grpc_tool.cc:250
grpc_core::InterceptRecvTrailingMetadataCallback
std::function< void(const TrailingMetadataArgsSeen &)> InterceptRecvTrailingMetadataCallback
Definition: test_lb_policies.h:45
cb
OPENSSL_EXPORT pem_password_cb * cb
Definition: pem.h:351
grpc_core::TrailingMetadataArgsSeen::status
absl::Status status
Definition: test_lb_policies.h:39


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:28