create_test_channel.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. #ifndef GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H
  19. #define GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H
  20. #include <memory>
  21. #include <grpcpp/channel.h>
  22. #include <grpcpp/impl/codegen/client_interceptor.h>
  23. #include <grpcpp/security/credentials.h>
  24. #include <grpcpp/support/channel_arguments.h>
  25. namespace grpc {
  26. class Channel;
  27. namespace testing {
  28. typedef enum { INSECURE = 0, TLS, ALTS } transport_security;
  29. } // namespace testing
  30. std::shared_ptr<Channel> CreateTestChannel(
  31. const std::string& server, testing::transport_security security_type);
  32. std::shared_ptr<Channel> CreateTestChannel(
  33. const std::string& server, const std::string& override_hostname,
  34. testing::transport_security security_type, bool use_prod_roots);
  35. std::shared_ptr<Channel> CreateTestChannel(
  36. const std::string& server, const std::string& override_hostname,
  37. testing::transport_security security_type, bool use_prod_roots,
  38. const std::shared_ptr<CallCredentials>& creds);
  39. std::shared_ptr<Channel> CreateTestChannel(
  40. const std::string& server, const std::string& override_hostname,
  41. testing::transport_security security_type, bool use_prod_roots,
  42. const std::shared_ptr<CallCredentials>& creds,
  43. const ChannelArguments& args);
  44. std::shared_ptr<Channel> CreateTestChannel(
  45. const std::string& server, const std::string& cred_type,
  46. const std::string& override_hostname, bool use_prod_roots,
  47. const std::shared_ptr<CallCredentials>& creds,
  48. const ChannelArguments& args);
  49. std::shared_ptr<Channel> CreateTestChannel(
  50. const std::string& server, const std::string& credential_type,
  51. const std::shared_ptr<CallCredentials>& creds);
  52. std::shared_ptr<Channel> CreateTestChannel(
  53. const std::string& server, const std::string& override_hostname,
  54. testing::transport_security security_type, bool use_prod_roots,
  55. const std::shared_ptr<CallCredentials>& creds,
  56. std::vector<
  57. std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
  58. interceptor_creators);
  59. std::shared_ptr<Channel> CreateTestChannel(
  60. const std::string& server, const std::string& override_hostname,
  61. testing::transport_security security_type, bool use_prod_roots,
  62. const std::shared_ptr<CallCredentials>& creds, const ChannelArguments& args,
  63. std::vector<
  64. std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
  65. interceptor_creators);
  66. std::shared_ptr<Channel> CreateTestChannel(
  67. const std::string& server, const std::string& cred_type,
  68. const std::string& override_hostname, bool use_prod_roots,
  69. const std::shared_ptr<CallCredentials>& creds, const ChannelArguments& args,
  70. std::vector<
  71. std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
  72. interceptor_creators);
  73. std::shared_ptr<Channel> CreateTestChannel(
  74. const std::string& server, const std::string& credential_type,
  75. const std::shared_ptr<CallCredentials>& creds,
  76. std::vector<
  77. std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
  78. interceptor_creators);
  79. } // namespace grpc
  80. #endif // GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H