ZeroTierOne/nonfree/controller/ControllerConfig.hpp
Grant Limberg a5bd262b3a Wiring through initialization of the CentralDB version of the controller
Still need to do the actual configuration from local.conf
2025-09-02 13:30:08 -07:00

66 lines
No EOL
1.2 KiB
C++

#ifndef CONTROLLER_CONFIG_HPP
#define CONTROLLER_CONFIG_HPP
#include "Redis.hpp"
#include <string>
namespace ZeroTier {
struct PubSubConfig {
std::string project;
};
struct PostgresNotifyConfig {
std::string channel;
};
struct BigTableConfig {
std::string project_id;
std::string instance_id;
std::string table_id;
};
struct ControllerConfig {
bool ssoEnabled;
std::string listenMode;
std::string statusMode;
RedisConfig* redisConfig;
PubSubConfig* pubSubConfig;
PostgresNotifyConfig* postgresNotifyConfig;
BigTableConfig* bigTableConfig;
ControllerConfig()
: ssoEnabled(false)
, listenMode("")
, statusMode("")
, redisConfig(nullptr)
, pubSubConfig(nullptr)
, postgresNotifyConfig(nullptr)
, bigTableConfig(nullptr)
{
}
~ControllerConfig()
{
if (redisConfig) {
delete redisConfig;
redisConfig = nullptr;
}
if (pubSubConfig) {
delete pubSubConfig;
pubSubConfig = nullptr;
}
if (postgresNotifyConfig) {
delete postgresNotifyConfig;
postgresNotifyConfig = nullptr;
}
if (bigTableConfig) {
delete bigTableConfig;
bigTableConfig = nullptr;
}
}
};
} // namespace ZeroTier
#endif // CONTROLLER_CONFIG_HPP