aboutsummaryrefslogtreecommitdiffstats
path: root/src/KuksaConfig.h
blob: e70385f8176138ccc2162bdaebd910e4fef0e7d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * Copyright (C) 2022,2023 Konsulko Group
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _KUKSA_CONFIG_H
#define _KUKSA_CONFIG_H

#include <string>

class KuksaConfig
{
public:
        explicit KuksaConfig(const std::string &hostname,
			     const unsigned port,
			     const std::string &caCert,
			     const std::string &tlsServerName,
			     const std::string &authToken);
        explicit KuksaConfig(const std::string &appname);
        ~KuksaConfig() {};

	std::string hostname() { return m_hostname; };
	unsigned port() { return m_port; };
	std::string caCert() { return m_caCert; };
	std::string tlsServerName() { return m_tlsServerName; };
	std::string authToken() { return m_authToken; };
	bool valid() { return m_valid; };
	unsigned verbose() { return m_verbose; };

private:
	std::string m_hostname;
	unsigned m_port;
	std::string m_caCert;
	std::string m_tlsServerName;
	std::string m_authToken;
	unsigned m_verbose;
	bool m_valid;

	void readFile(const std::string &filename, std::string &data);
};

#endif // _KUKSA_CONFIG_H