create Credentials class to specify all credentials there.
This commit is contained in:
32
inc/Credentials.h
Normal file
32
inc/Credentials.h
Normal file
@ -0,0 +1,32 @@
|
||||
//
|
||||
// Created by lukas on 11.02.20.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <string>
|
||||
|
||||
class Credentials {
|
||||
public:
|
||||
static const std::string dynuapikey;
|
||||
|
||||
static const std::string domainid; //id of the dynu domain
|
||||
static const std::string domainname;
|
||||
|
||||
static const std::string telegramApiKey;
|
||||
static const std::string chatId;
|
||||
|
||||
static bool checkCredentialValidity();
|
||||
};
|
||||
|
||||
const std::string Credentials::dynuapikey = "";
|
||||
const std::string Credentials::domainid = ""; //id of the dynu domain
|
||||
const std::string Credentials::domainname = "";
|
||||
|
||||
static const std::string Credentials::telegramApiKey = "";
|
||||
static const std::string Credentials::chatId = "";
|
||||
|
||||
bool Credentials::checkCredentialValidity() {
|
||||
return !(dynuapikey.empty() || domainid.empty() || domainname.empty());
|
||||
}
|
@ -4,7 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "API.h"
|
||||
|
||||
class DynuAPI : API{
|
||||
@ -15,9 +14,17 @@ public:
|
||||
* @return request status
|
||||
*/
|
||||
int refreshIp(std::string ip);
|
||||
private:
|
||||
const std::string dynuapikey = "88vNpMfDhMM2YYDNfWR1DNYfRX9W6fYg";
|
||||
|
||||
const std::string domainid = "8506047"; //id of the dynu domain
|
||||
const std::string domainname = "luki.dynu.net";
|
||||
/**
|
||||
* init Telegram api with apikey and chatid
|
||||
* @param dynuApiKey Dynu Api key
|
||||
* @param domainId ID of domain received by Dynu
|
||||
* @param domainName domainname to refresh
|
||||
*/
|
||||
void init(std::string dynuApiKey, std::string domainId, std::string domainName);
|
||||
private:
|
||||
std::string dynuapikey;
|
||||
|
||||
std::string domainid; //id of the dynu domain
|
||||
std::string domainname;
|
||||
};
|
||||
|
Reference in New Issue
Block a user