You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
923 B

1 year ago
#include "kafka_config.h"
KafkaConfig* KafkaConfig::getIns() {
static KafkaConfig kafkaConfig;
return &kafkaConfig;
}
KafkaConfig::KafkaConfig() = default;
void KafkaConfig::load(QSettings *configs) {
if(configs->value("consumer.servers").isValid()){
_consumerServers = configs->value("consumer.servers").toStringList();
}
if(configs->value("consumer.topics").isValid()){
_consumerTopics = configs->value("consumer.topics").toStringList();
}
if(configs->value("producer.servers").isValid()){
_producerServers = configs->value("producer.servers").toStringList();
}
}
QStringList KafkaConfig::getConsumerServers() const {
return _consumerServers;
}
QStringList KafkaConfig::getConsumerTopics() const {
return _consumerTopics;
}
QStringList KafkaConfig::getProducerServers() const {
return _producerServers;
}
KafkaConfig::~KafkaConfig() = default;