• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *
3  * Copyright 2015-2016 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H
20 #define GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H
21 
22 #include <memory>
23 
24 #include <grpcpp/channel.h>
25 #include <grpcpp/impl/codegen/client_interceptor.h>
26 #include <grpcpp/security/credentials.h>
27 #include <grpcpp/support/channel_arguments.h>
28 
29 namespace grpc_impl {
30 
31 class Channel;
32 }
33 
34 namespace grpc {
35 
36 namespace testing {
37 
38 typedef enum { INSECURE = 0, TLS, ALTS } transport_security;
39 
40 }  // namespace testing
41 
42 std::shared_ptr<Channel> CreateTestChannel(
43     const std::string& server, testing::transport_security security_type);
44 
45 std::shared_ptr<Channel> CreateTestChannel(
46     const std::string& server, const std::string& override_hostname,
47     testing::transport_security security_type, bool use_prod_roots);
48 
49 std::shared_ptr<Channel> CreateTestChannel(
50     const std::string& server, const std::string& override_hostname,
51     testing::transport_security security_type, bool use_prod_roots,
52     const std::shared_ptr<CallCredentials>& creds);
53 
54 std::shared_ptr<Channel> CreateTestChannel(
55     const std::string& server, const std::string& override_hostname,
56     testing::transport_security security_type, bool use_prod_roots,
57     const std::shared_ptr<CallCredentials>& creds,
58     const ChannelArguments& args);
59 
60 std::shared_ptr<Channel> CreateTestChannel(
61     const std::string& server, const std::string& cred_type,
62     const std::string& override_hostname, bool use_prod_roots,
63     const std::shared_ptr<CallCredentials>& creds,
64     const ChannelArguments& args);
65 
66 std::shared_ptr<Channel> CreateTestChannel(
67     const std::string& server, const std::string& credential_type,
68     const std::shared_ptr<CallCredentials>& creds);
69 
70 std::shared_ptr<Channel> CreateTestChannel(
71     const std::string& server, const std::string& override_hostname,
72     testing::transport_security security_type, bool use_prod_roots,
73     const std::shared_ptr<CallCredentials>& creds,
74     std::vector<
75         std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
76         interceptor_creators);
77 
78 std::shared_ptr<Channel> CreateTestChannel(
79     const std::string& server, const std::string& override_hostname,
80     testing::transport_security security_type, bool use_prod_roots,
81     const std::shared_ptr<CallCredentials>& creds, const ChannelArguments& args,
82     std::vector<
83         std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
84         interceptor_creators);
85 
86 std::shared_ptr<Channel> CreateTestChannel(
87     const std::string& server, const std::string& cred_type,
88     const std::string& override_hostname, bool use_prod_roots,
89     const std::shared_ptr<CallCredentials>& creds, const ChannelArguments& args,
90     std::vector<
91         std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
92         interceptor_creators);
93 
94 std::shared_ptr<Channel> CreateTestChannel(
95     const std::string& server, const std::string& credential_type,
96     const std::shared_ptr<CallCredentials>& creds,
97     std::vector<
98         std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
99         interceptor_creators);
100 
101 }  // namespace grpc
102 
103 #endif  // GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H
104