ServerConfig.h 990 字节
Newer Older
G
groot 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*******************************************************************************
 * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
 * Unauthorized copying of this file, via any medium is strictly prohibited.
 * Proprietary and confidential.
 ******************************************************************************/
#pragma once

#include "utils/Error.h"
#include "config/ConfigNode.h"

#include <yaml-cpp/yaml.h>

namespace zilliz {
namespace vecwise {
namespace server {

static const std::string CONFIG_SERVER = "server_config";
G
groot 已提交
18
static const std::string CONFIG_LOG = "log_config";
G
groot 已提交
19 20 21

class ServerConfig {
 public:
G
groot 已提交
22
    static ServerConfig &GetInstance();
G
groot 已提交
23 24 25 26

    ServerError LoadConfigFile(const std::string& config_filename);
    void PrintAll() const;

G
groot 已提交
27 28
    ConfigNode GetConfig(const std::string& name) const;
    ConfigNode& GetConfig(const std::string& name);
G
groot 已提交
29 30 31 32 33 34 35 36 37

    std::string GetServerAddress() const;
    std::string GetServerPort() const;
};

}
}
}