ControllerConfig.hpp 948 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. };
  9. struct BigTableConfig {
  10. std::string project_id;
  11. std::string instance_id;
  12. std::string table_id;
  13. };
  14. struct ControllerConfig {
  15. bool ssoEnabled;
  16. std::string listenMode;
  17. std::string statusMode;
  18. RedisConfig* redisConfig;
  19. PubSubConfig* pubSubConfig;
  20. BigTableConfig* bigTableConfig;
  21. ControllerConfig()
  22. : ssoEnabled(false)
  23. , listenMode("")
  24. , statusMode("")
  25. , redisConfig(nullptr)
  26. , pubSubConfig(nullptr)
  27. , bigTableConfig(nullptr)
  28. {
  29. }
  30. ~ControllerConfig()
  31. {
  32. if (redisConfig) {
  33. delete redisConfig;
  34. redisConfig = nullptr;
  35. }
  36. if (pubSubConfig) {
  37. delete pubSubConfig;
  38. pubSubConfig = nullptr;
  39. }
  40. if (bigTableConfig) {
  41. delete bigTableConfig;
  42. bigTableConfig = nullptr;
  43. }
  44. }
  45. };
  46. } // namespace ZeroTier
  47. #endif // CONTROLLER_CONFIG_HPP