ControllerConfig.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef CONTROLLER_CONFIG_HPP
  2. #define CONTROLLER_CONFIG_HPP
  3. #include "Redis.hpp"
  4. #include <string>
  5. namespace ZeroTier {
  6. struct PubSubConfig {
  7. std::string project_id;
  8. std::string member_change_recv_topic;
  9. std::string member_change_send_topic;
  10. std::string network_change_recv_topic;
  11. std::string network_change_send_topic;
  12. };
  13. struct BigTableConfig {
  14. std::string project_id;
  15. std::string instance_id;
  16. std::string table_id;
  17. };
  18. struct ControllerConfig {
  19. bool ssoEnabled;
  20. std::string listenMode;
  21. std::string statusMode;
  22. RedisConfig* redisConfig;
  23. PubSubConfig* pubSubConfig;
  24. BigTableConfig* bigTableConfig;
  25. ControllerConfig()
  26. : ssoEnabled(false)
  27. , listenMode("")
  28. , statusMode("")
  29. , redisConfig(nullptr)
  30. , pubSubConfig(nullptr)
  31. , bigTableConfig(nullptr)
  32. {
  33. }
  34. ~ControllerConfig()
  35. {
  36. if (redisConfig) {
  37. delete redisConfig;
  38. redisConfig = nullptr;
  39. }
  40. if (pubSubConfig) {
  41. delete pubSubConfig;
  42. pubSubConfig = nullptr;
  43. }
  44. if (bigTableConfig) {
  45. delete bigTableConfig;
  46. bigTableConfig = nullptr;
  47. }
  48. }
  49. };
  50. } // namespace ZeroTier
  51. #endif // CONTROLLER_CONFIG_HPP