-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathSettings.h
64 lines (54 loc) · 1.92 KB
/
Settings.h
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// Created by armin on 21.04.19.
//
#ifndef ROCKETCHATMOBILEPUSHGATEWAY_SETTINGS_H
#define ROCKETCHATMOBILEPUSHGATEWAY_SETTINGS_H
#include <string>
#include "trantor/utils/Logger.h"
class Settings {
typedef struct
{
std::string type;
std::string project_id;
std::string private_key_id;
std::string private_key;
std::string client_email;
std::string client_id;
std::string auth_uri;
std::string token_uri;
std::string auth_provider_x509_cert_url;
std::string client_x509_cert_url;
std::string universe_domain;
} GoogleServiceAccount;
public:
static void init();
static bool setGoogleCredentialsFromServiceAccountJson(const std::string &pServiceAccountJson);
static bool forwardGatewayEnabled();
static trantor::Logger::LogLevel getLogLevel();
static const std::string &forwardGatewayUrl();
static const GoogleServiceAccount &fcmServiceAccount();
static const std::string &fcmProjectId();
static const std::string &fcmApiEndpoint();
static const std::string &apnsPrivateKey();
static const std::string &apnsTeamId();
static const std::string &apnsAppId();
static const std::string &apnsKey();
static const std::string &apnsPrivateKeyAlgo();
private:
static void loadApnKeyFile();
static void loadApnSettingsFile();
static void loadFcmServiceAccountJson();
static bool mForwardGatewayEnabled;
static trantor::Logger::LogLevel mLogLevel;
static std::string mForwardGatewayUrl;
static GoogleServiceAccount mFcmServiceAccount;
static std::string mFcmProjectId;
static std::string mFcmApiEndpoint;
static std::string mApnsPrivateKey;
static std::string mApnsTeamId;
static std::string mApnsKey;
static std::string mApnsAppId;
static std::string mApnsPrivateKeyAlgo;
static std::string mConfigDir;
};
#endif //ROCKETCHATMOBILEPUSHGATEWAY_SETTINGS_H