droplet 1.1.0
A multipurpose Discord bot with the hacker in mind
 
Loading...
Searching...
No Matches
Secrets.hpp
Go to the documentation of this file.
1/*
2 * (c) Copyright erarnitox.de - All rights reserved
3 * Author: Erarnitox <david@erarnitox.de>
4 *
5 * License: MIT License
6 *
7 * Description: This class provides a Singleton to access secrets
8 *
9 * Documentation: https://droplet.erarnitox.de/doxygen/html/database
10 */
11
12#pragma once
13
14#include <Poco/JSON/Object.h>
15#include <Poco/JSON/Parser.h>
16
17#include <string>
18
19//-----------------------------------------------------
20//
21//-----------------------------------------------------
22class Secrets {
23 public:
24 static Secrets& getInstance();
25 [[nodiscard]] std::string getSecret(const std::string& key, const std::string& fallback = "") const;
26
27 private:
28 Secrets();
29 Secrets(const Secrets&) = delete;
30 Secrets& operator=(const Secrets&) = delete;
31
32 Poco::JSON::Object::Ptr secrets;
33};
std::string getSecret(const std::string &key, const std::string &fallback="") const
Definition Secrets.cpp:27
static Secrets & getInstance()
Definition Secrets.cpp:19